List<WebElement> productList = driver.findElements(By.className("list-item"));
// for (WebElement webElement : productList) {
// if (webElement.getText().equals("天利测试-xf22")) {
// System.out.println(webElement.getText().toString());
// }
// }
String all = driver.findElement(By.id("allopt")).getText();
for (Iterator iterator = productList.iterator(); iterator.hasNext();) {
WebElement webElement = (WebElement) iterator.next();
System.out.println(webElement.getText().toString());
System.out.println("------------------------------------------------");
}
Java遍历
最新推荐文章于 2024-08-02 10:48:40 发布