The image capture class
Another important library to include in the framework is the image capture class. It is used by the test listener, reporter, and test classes to take screenshots of the browser or mobile screens when exceptions occur. There are various methods that can be built to capture the image of the entire screen, an individual WebElement or MobileElement, or to compare the images. Each method will be outlined here:
Note
The image capture methods were developed by Unmesh Gundecha, and published by Packt Publishing in the reference book Selenium Testing Tools Cookbook - Second Edition. The book is available at https://www.packtpub.com/web-development/selenium-testing-tools-cookbook-second-edition.
/** * Image Capture and Compare Class * * @author Name * */ public class ImageCapture { // constructor public ImageCapture() throws Exception { } ...
The capture screen method
There are many ways to capture and name the image of the screen. Using the test method name...