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值