I am trying to execute a script for login into webpage.Can any1 help me solve dis problem?
I am getting below error:-
The data provider is trying to pass 7 parameters but the method
efgh.DataDriven#login takes 2
public class DataDriven {
public WebDriver driver;
@Test(dataProvider ="testdata")
public void login(String username, String password){
driver=new ChromeDriver();
driver.get("https://pos.lycamobile.es/Login/login.aspx?lang=ES");
driver.findElement(By.name("UserName")).sendKeys(username);
driver.findElement(By.name("Password")).sendKeys(password);
driver.close();
}
@DataProvider(name = "testdata")
public Object [] [] readExcel() throws BiffException, IOException {
File f =new File("D:\\Users\\sarsiddi\\Documents\\DataSheet.xls");
Workbook w = Workbook.getWorkbook(f);
Sheet s= w.getSheet("lycadata");
int rows = s.getRows();
int columns = s.getColumns();
// System.out.println(rows);
// System.out.println(columns);
String inputData[] [] = new String [rows] [columns];
for (int i=0; i<rows; i++){
for (int j=0; j<columns; j++){
Cell c = s.getCell(j, i);
inputData [i][j] = c.getContents();
//System.out.println(inputData[i][j]);
}
}
return inputData;
}
}