public class loginAgain { @Test(dataProvider="getData") public void login(String Browser,String Username,String Password,String Expected){ System.out.println(Username+"__"+Password); String caseA="Sorry, Google doesn't recognize that email."; String caseB="Please enter your email."; String caseC="Please enter your password.";
@DataProvider public Object[][] getData(){ Xls_Reader xls=new Xls_Reader("C:\\Users\\sanja\\Desktop\\webuy.xlsx"); int rows=xls.getRowCount("sheet3"); int cols=xls.getColumnCount("sheet3"); Object[][] data=new Object[rows-1][cols]; for(int rNum=2;rNum<=rows;rNum++){ for(int cNum=0;cNum<cols;cNum++){ data[rNum-2][cNum]=xls.getCellData("sheet3", cNum, rNum); } } return data; }
}
-----No such element exception I am using the corect xpath of password.-----Could you please tell how to read invalid data.In real time do we have to read like this
excel data--- Browser Username Password Expected Firefox jyosh.ma Sorry, Google doesn't recognize that email. Firefox Please enter your email. Firefox jyosh.maddy@gmail.com Please enter your password.
Thank you in advance
M
Replied on 18/07/2016
what are you trying to do?
M
Replied on 18/07/2016
Reading invalid data and blank data from excel.
M
Replied on 18/07/2016
you cannot read blank data.
M
Replied on 18/07/2016
you cannot read blank data. it will give you an error.