我得到Null值错误,如java.lang.AssertionError:列表在元素[0]上有所不同:!= Selenium expected []但找到[Selenium]

时间:2018-05-30 13:09:47

标签: java html selenium automation

driver.manage().timeouts().implicitlyWait(5000, TimeUnit.SECONDS);  
driver.findElement(By.xpath("//*[@id=\"company_info\"]/div[2]/button[2]")).click();
driver.manage().timeouts().implicitlyWait(5000, TimeUnit.SECONDS);  
Thread.sleep(3000);
driver.findElement(By.xpath("//*[@id=\"tblcompany\"]/tbody/tr[1]/td[8]/a")).click();
Thread.sleep(3000);
List<WebElement> rows1 = driver.findElements(By.xpath("//html/body/div/div[2]/div/div/div//div//input"));
List<String> all_elements_text1=new ArrayList<>();
for(int i=0; i<rows1.size(); i++){
    //loading text of each element in to array all_elements_text
   all_elements_text1.add(rows1.get(i).getText());
   System.out.println(rows1.get(i).getText());
}

当我执行上面的代码时,我在控制台窗口中获取所有Null值

0 个答案:

没有答案