代码:
try {
//load file into java
Workbook workbook=Workbook.getWorkbook(sourceForCustomerGroup);
//load sheet number (0 is sheet 1)
Sheet sheetForGroups= workbook.getSheet(0);
Cell c1 = sheetForGroups.getCell(customerColumn, customerRow);
String customerGroupName = c1.getContents();
for (int i = 0; i<sheetForGroups.getRows(); i++, customerRow++) {
driver.findElement(By.id("tab3")).click();
driver.findElement(By.id("new")).click();
driver.findElement(By.id("GroupName")).clear();
driver.findElement(By.id("GroupName")).sendKeys(customerGroupName);
driver.findElement(By.id("save")).click();
customerRow = 1;
customerColumn = 1;
for (int j = 0; j<sheetForGroups.getRows()-1; j++, customerRow++) {
Cell c2 = sheetForGroups.getCell(customerColumn, customerRow);
String clientUserID = c2.getContents();
driver.findElement(By.id("clientuserid1")).clear();
driver.findElement(By.id("clientuserid1")).sendKeys(clientUserID);
driver.findElement(By.id("add")).click();
}
//doesn't work here
driver.findElement(By.id("actions")).click();
driver.findElement(By.id("save")).click();
}
}
在第二个for循环之后,代码似乎没有运行命令。我试过手动跟踪它,我认为我没有犯任何逻辑错误(我希望我能够纠正)。怎么了?