selenium - 如何验证页面上的图片是否正确显示

标签 selenium selenium-webdriver

我需要验证上传的图像是否正确显示,即它在页面上没有扭曲。有没有办法验证这一点?我知道我可以通过内容或屏幕截图进行验证,但这需要手动检查。

提前致谢!

最佳答案

严格来说,如果不进行屏幕截图,您无法确定页面上是否显示了所需的图像。这就是needle package可能会有用。

但是,如果您想避免这种情况,至少可以验证两件事:

关于selenium - 如何验证页面上的图片是否正确显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28867985/

相关文章:

java - 无法通过webdriver定位动态元素

java - sendKeys.RETURN 在 FirefoxDriver 中不起作用

java.lang.OutOfMemory错误: GC overhead limit exceeded"while reading excel file using apache POI

python - KeyError : 'driver' in print(response. request.meta ['driver' ].title)

java - org.openqa.selenium.remote.service.DriverService$Builder.createArgs()Lcom/google/common/collect/ImmutableList;使用 Selenium 3.5.3 Chrome 76

macos - 用于创建 macOS 应用程序的 cx_Freeze 编码

java - 无法使用 Selenium Webdriver 和 Java 在 Quora 中注册新帐户

python - get_text() 或文本属性不适用于标签

python - Selenium 无法打开指定的 URL 并显示数据 :,

c# - 缺少[程序集 :RuntimePlugin] attribute in SpecFlowPlugin