Search code examples
javaseleniumashotselenium-shutterbug

Difference between aShot and Shutterbug in selenium


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


Solution

  • 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