英文:
Difference between aShot and Shutterbug in selenium
问题
我正在尝试学习如何在Selenium中捕获屏幕截图。了解到了 aShot() 和 Shutterbug 类,它们是用于 WebDriver 的第三方 API。
这两者之间的关键区别是什么,哪个更有优势呢?
提前感谢您。
英文:
I a trying to learn capturing screenshots in selenium. Came to know about aShot() and Shutterbug classes which is a third party Api for webdriver.
What are the key Differences and Which has Advantages
Thanks in Advance
答案1
得分: 2
ashot
ashot 是一个用于截取屏幕截图、裁剪、美化和比较的 WebDriver 实用程序。它可用于以下用途:
- 在不同平台上(如桌面浏览器、iOS 模拟器移动 Safari、Android 模拟器浏览器)上对 WebElement 进行截图。
- 对截图进行装饰。
- 提供灵活的截图比较。
Maven 依赖:
<dependency>
<groupId>ru.yandex.qatools.ashot</groupId>
<artifactId>ashot</artifactId>
<version>1.5.2</version>
</dependency>
您可以在以下详细讨论中找到相关内容:
selenium-shutterbug
selenium-shutterbug 是一个用于使用 Selenium WebDriver 进行截图的 Java 实用程序库,并借助 Java AWT 进行进一步的定制、比较和处理。
Maven 依赖:
<dependency>
<groupId>com.assertthat</groupId>
<artifactId>selenium-shutterbug</artifactId>
<version>x.x</version>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
</exclusion>
</exclusions>
</dependency>
使用 Gradle:
compile ('com.assertthat:selenium-shutterbug:x.x') {
exclude group: "org.seleniumhq.selenium", name: "selenium-java"
}
使用 SBT:
"com.assertthat" % "selenium-shutterbug" % "x.x" exclude("org.seleniumhq.selenium", "selenium-java")
您可以在以下讨论中找到相关内容:
差异
它们之间的主要区别是,[tag:ashot] 仅在网页支持 [tag:jquery] 时才能工作。
参考资料
英文:
ashot
ashot is a WebDriver [tag:screenshot] utility to take screenshots, crop, prettify, compare. It can be used for the following purposes:
- Taking a screenshot of a WebElement on different platforms (i.e. desktop browsers, iOS Simulator Mobile Safari, Android Emulator Browser)
- Decorating screenshots.
- Providing flexible screenshot comparisons.
Maven dependency:
<dependency>
<groupId>ru.yandex.qatools.ashot</groupId>
<artifactId>ashot</artifactId>
<version>1.5.2</version>
</dependency>
You can find a couple of detailed relevant discussions in:
- How to capture screenshot of a WebElement within a webpage but not the entire screen or page through Selenium
- How to take full page screenshot using AShot library through Selenium and Java
selenium-shutterbug
selenium-shutterbug is a utility library written in Java for making screenshots using Selenium WebDriver and further customizing, comparing and processing them with the help of Java AWT.
Maven dependency:
<dependency>
<groupId>com.assertthat</groupId>
<artifactId>selenium-shutterbug</artifactId>
<version>x.x</version>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
</exclusion>
</exclusions>
</dependency>
Using Gradle:
compile ('com.assertthat:selenium-shutterbug:x.x') {
exclude group: "org.seleniumhq.selenium", name: "selenium-java"
}
Using SBT:
"com.assertthat" % "selenium-shutterbug" % "x.x" exclude("org.seleniumhq.selenium", "selenium-java"),
You can find a couple of relevant discussions in:
- Can the screeenshots generated by selenium-shutterbug be saved with extension as jpg instead of png?
Difference
The big difference between them is, [tag:ashot] works only when the webpage supports [tag:jquery].
Reference
答案2
得分: 0
Ashot() source
> Ashot()是Selenium WebDriver支持的第三方实用工具,用于捕获屏幕截图。以下是aShot()实用程序支持的屏幕截图功能:
>
> 捕获整个页面
> 捕获Web元素
> 美化截图
> 截图比较
> 多个元素比较
>
> 我们在这里关注捕获整个页面和捕获Web元素截图。
Shutterstock source 不确定是否是在Selenium中捕获截图的工具
> Shutterstock是美国的提供库存摄影、库存视频、库存音乐和编辑工具的供应商;
如果您想执行上述提到的其他操作,如“捕获整个页面”、“截图比较”等,需要一些第三方库。其中之一就是aShot
。
除此之外,我们还可以使用Selenium中的TakesScreenshot接口简单地捕获仅可见部分的屏幕截图。
英文:
Ashot() source
> Ashot() is a third party utility supported by Selenium WebDriver to
> capture the screen shots. The below are the features supported by
> aShot() utility with repect to screenshots:
>
> Capturing the entire page
> Capture the Web Element
> Prettifying the screenshot
> Screenshot comparison
> Several elements comparison
>
> Our focus here is on capturing the entire page and capturing the web
> element screenshots.
Shutterstock source Not sure whether its a tool to capture screenshots in selenium
> Shutterstock is an American provider of stock photography, stock
> footage, stock music, and editing tools;
If you want to perform some other things like Capturing the entire page
, Screenshot comparison
etc. as mentioned above. Need some third part libraries. aShot
is one of them.
Other then this we can simply capture only visible part screenshot using TakesScreenshot interface in Selenium.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论