僅顯示可見光圖像現在我的應用程序只顯示12在前端的圖像,但同時通過的XPath獲取它顯示18張圖像。如何通過硒腳本
使用的X路徑爲:
driver.findElemnt(By.xpath("xpath")).size();
使用的代碼:
int showCount = driver.findElements(By.xpath(ObjRepoProp.getProperty("homePageShowLogoImage_XPATH"))).size();
for (int i = 1; i <= showCount; i++) {
driver.findElement(By.xpath(ObjRepoProp.getProperty("homePageShowLogoImage_XPATH"))).isDisplayed();
i=i+1;
log.info(i + "shows are present in GET TO KNOW THE SHOW section (Count of only shows which are displaying on screen).\n");
}
我需要顯示僅12張圖像。
添加實際XPath和頁面的源代碼,以您的問題... – Grasshopper