以下是我正在使用的代码:
@Test
public void excel() throws JXLException, IOException
{
String FilePath = "C://Users//QA Rahul Singh//Desktop//dat.xls";
FileInputStream fs = new FileInputStream(FilePath);
Workbook wb = Workbook.getWorkbook(fs);
Sheet wrksheet = wb.getSheet(0);
String data = wb.getCell("A1").getContents();
driver.findElement(By.id("inputUsername")).sendKeys(data);
driver.findElement(By.id("btnRegisterUser")).click();
}