aShot和Shutterbug在Selenium中的区别

huangapple go评论79阅读模式
英文:

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] 时才能工作。


参考资料

如何使用 Selenium WebDriver 进行截图

英文:

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:

&lt;dependency&gt;
    &lt;groupId&gt;ru.yandex.qatools.ashot&lt;/groupId&gt;
    &lt;artifactId&gt;ashot&lt;/artifactId&gt;
    &lt;version&gt;1.5.2&lt;/version&gt;
&lt;/dependency&gt;

You can find a couple of detailed relevant discussions in:


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:

&lt;dependency&gt;
    &lt;groupId&gt;com.assertthat&lt;/groupId&gt;
    &lt;artifactId&gt;selenium-shutterbug&lt;/artifactId&gt;
    &lt;version&gt;x.x&lt;/version&gt;
    &lt;exclusions&gt;
	&lt;exclusion&gt;
	    &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
	    &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
	&lt;/exclusion&gt;
     &lt;/exclusions&gt;
&lt;/dependency&gt;

Using Gradle:

compile (&#39;com.assertthat:selenium-shutterbug:x.x&#39;) {
    exclude group: &quot;org.seleniumhq.selenium&quot;, name: &quot;selenium-java&quot;
    }

Using SBT:

&quot;com.assertthat&quot; % &quot;selenium-shutterbug&quot; % &quot;x.x&quot; exclude(&quot;org.seleniumhq.selenium&quot;, &quot;selenium-java&quot;),

You can find a couple of relevant discussions in:


Difference

The big difference between them is, [tag:ashot] works only when the webpage supports [tag:jquery].


Reference

How to take screenshot with Selenium WebDriver

答案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.

huangapple
  • 本文由 发表于 2020年3月16日 18:46:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/60704508.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定