The Ashot API provides the following features:
- Takes a screenshot of an individual WebElement on different platforms (such as desktop browsers, iOS simulator, mobile Safari)
- Decorates the screenshots
- Provides screenshot comparison
Taking screenshots of individual WebElements is also possible with AShot.
AShot takes a screenshot in three steps:
- Captures a screenshot of the full page
- Finds the element's size and coordinates
- Adjusts the original screenshot by cropping
This way, AShot provides an image of the WebElement
To use AShot, add the dependency given here to pom.xml:
<dependency>
<groupId>ru.yandex.qatools.ashot</groupId>
<artifactId>ashot</artifactId>
<version>1.1</version>
</dependency>
The following code helps to take a full-page screenshot:
public class TakeScreenShot {
public static void main...