I'm trying to read username and password from the excel file, below is my code but it shows following error :
log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager). log4j:WARN Please initialize the log4j system properly.
Code:
public static void main(String[] args) throws BiffException, IOException {
Sheet s;
WebDriver driver = new FirefoxDriver();
FileInputStream fi = new FileInputStream("E:\\myExcelWorkBook.xls");
Workbook W = Workbook.getWorkbook(fi);
s = W.getSheet(0);
for(int row = 0;row <= s.getRows();row++){
String Username = s.getCell(0,row).getContents();
System.out.println("Username" +Username);
driver.get("AppURL");
driver.findElement(By.id("txtUserName")).sendKeys(Username);
String password= s.getCell(1, row).getContents();
System.out.println("Password "+password);
driver.findElement(By.id("txtPassword")).sendKeys(password);
driver.findElement(By.id("btnLogin")).click();
}
}
Please help me out.