如何在Java环境中使用Selenium自动化程序跳过一个excel行

我试图让一个selenium程序在特定的网站上线,login,然后把search框中的地址和地址,我从一个Excel文件,并在search完成后,在网站上添加审查。然而,有些地方已经审查,不能再次审查,所以我的问题是,当一个地方是审查如何使其再次search,但从下一个Excel单元格的信息,而不是使用相同的?我知道这可能是一个简单的回答这个,但我无法弄清楚如何更具体地search它。我希望你能帮助我。 这是我所有的代码。

public class Checkbot { public static void main(String[] args) throws InterruptedException { // TODO Auto-generated method stub try { //Open excel file String FilePath = "C:\\Users\\CandyGirl\\Documents\\DunkinDonuts1.6.2.xlsx"; FileInputStream fs = new FileInputStream(FilePath); XSSFWorkbook wb = new XSSFWorkbook(fs); //Access data sheet Sheet sh = wb.getSheet("Sheet6"); //Loop through rows for( int count = 0;count <=sh.getLastRowNum();count++){ Row row = sh.getRow(count); runTest(row.getCell(0).toString(),row.getCell(1).toString()); boolean reviewed; if(reviewed = true){ count++; } } fs.close(); }catch(IOException e){ System.out.println("Test data file not found"); } } private static void runTest(String searchWhat, String searchWhere) throws InterruptedException { // TODO Auto-generated method stub //Start browser driver to axs map website WebDriver driver = new ChromeDriver(); driver.get("http://www.axsmap.com/"); //log in //click Log In button driver.findElement(By.id("nav-login")).click(); //Enter username driver.findElement(By.id("username")).clear(); driver.findElement(By.id("username")).sendKeys(username); //Enter password driver.findElement(By.id("password")).clear(); driver.findElement(By.id("password")).sendKeys(password); //Press Enter to log in WebElement input = driver.findElement(By.id("password")); input.submit(); //try to make it wait before it crashes waitForLoad(driver); //if after the login the page shows an application error just go back to the main page boolean myTitle = driver.getTitle().contains("Application Error"); if (myTitle = true){ driver.get("http://www.axsmap.com/");} //Enter search what and where and send it searchPlace(searchWhat, searchWhere, driver); //try to make it wait to load,if there's an error go back to front page and try again. waitForLoad(driver); if (myTitle = true){ driver.get("http://www.axsmap.com/"); searchPlace(searchWhat,searchWhere,driver);} //when page loads to the map click add review driver.findElement(By.id("btn-add-review")).click(); //If reviewed waitForLoad(driver); boolean reviewed = driver.findElement(By.cssSelector("#pg-addreview > div > div > div.w-form.venue-review-form > div")).isDisplayed(); if (driver.findElement(By.cssSelector("#pg-addreview > div > div > div.w-form.venue-review-form > div")).isDisplayed()){ searchPlace(searchWhat,searchWhere,driver);} //find and click on the 4 star rating driver.findElement(By.cssSelector("#pg-addreview > div > div > div.w-form.venue-review-form > form > div:nth-child(2) > div > div > div.row-value.w-col.w-col-9.entry-stars > div:nth-child(6)")).click(); driver.close(); } private static void searchPlace(String searchWhat, String searchWhere, WebDriver driver) { //Find and type in the search What field driver.findElement(By.id("search-what")).clear(); WebElement element = driver.findElement(By.id("search-what")); element.sendKeys(searchWhat); //Find and type in the search Where field and press enter driver.findElement(By.id("search-where")).clear(); driver.findElement(By.id("search-where")).sendKeys(searchWhere); element.submit(); } public static void waitForLoad(WebDriver driver) { ExpectedCondition<Boolean> pageLoadCondition = new ExpectedCondition<Boolean>() { public Boolean apply(WebDriver driver) { return ((JavascriptExecutor)driver).executeScript("return document.readyState").equals("complete"); } }; WebDriverWait wait = new WebDriverWait(driver, 30); wait.until(pageLoadCondition); } 

}