Difference between aShot and Shutterbug in selenium

3k Views Asked by At

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

2

There are 2 best solutions below

2
On BEST ANSWER

ashot

ashot is a WebDriver 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:


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:


Difference

The big difference between them is, works only when the webpage supports .


Reference

How to take screenshot with Selenium WebDriver

1
On

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.