Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我们导航到页面并检查页面时,在网络监视器选项卡 > 图像下,我们会在页面加载时获得文件名列表(例如 imgge.png)。当我们使用 selenium 脚本导航到页面时,我如何识别图像是否存在。我附上了截图以供参考,我到底指的是什么。
在此处输入图像描述
driver.findElement(By.id("imagefile_id")).isDisplayed();
获取图像的 id 值并使用上面的脚本,它返回布尔值。