Workbook workbook = Workbook.getWorkbook(new File("C:\\Users\\Tsss-Pc1\\Desktop\\login.xls"));
Sheet sheet = workbook.getSheet(0);
String uname = sheet.getCell(0, 0).getContents();
d.findElement(By.id("inputEmail")).sendKeys(uname);
String pwd = sheet.getCell(1, 0).getContents();
d.findElement(By.id("inputPassword")).sendKeys(pwd);
d.findElement(By.xpath("//div[3]/div/button")).click();
这是我从 login.xls 读取用户名和密码的代码,我想将结果附加到同一文件的第三列中。
WritableCell label = new Label(2,0, "pass");
WritableSheet sheet1 = null;
sheet1.addCell(label);
我尝试使用此代码,但它对我不起作用..谁能告诉我,如何做到这一点...