
Explore visual testing with Selenium and TestNG, learn to capture screenshots, compare them to a baseline, detect regression, highlight differences, and generate reports with Jenkins in a Maven-driven CI workflow.
Install IntelliJ IDEA Community Edition by downloading the setup and running the installation wizard with default settings. Prepare your environment for Maven projects in the next session.
Configure selenium by installing and referencing the chrome driver, creating and using a driver instance, and ensuring the browser is ready for automated tests.
Configured the webdriver and chrome driver to take screenshots for visual regression testing, and set up baseline, screenshots, and diff images with a Java screen capture utility.
Implement a public method in the screen capture utility to capture the entire page with a web driver and save a buffered image as png in the screenshots folder.
Implement a method to take a screenshot of a specific element using selenium and Ashot, locate the element by xpath, and save the image for visual testing with TestNG.
Develop and automate baseline image preparation for visual testing with Selenium and TestNG by collecting urls, logging in, and capturing screenshots with a data provider.
Create a well-structured visual regression test suite in Java using test annotations, initialize a WebDriver, run login, and clean differential and screenshot directories before executing regression.
Implement data-driven visual regression tests using Selenium and TestNG by taking page screenshots, comparing them with baseline images, and asserting equality with a data provider using urls and baseline titles.
Create automated visual test reports for regression runs using extend reports with Selenium and TestNG. Attach screenshots with red defects, set up report in Maven, and log and flush results.
Learn to attach differential screenshots to test reports in Selenium and TestNG by passing the image name via test context and embedding the screen capture in the report.
Learn to run a visual regression suite with an XML file, configuring multiple test classes under regression.xml, and execute it via right-click or Maven with a regression profile.
Enhance the take page screenshot method by integrating a scrolling shooting strategy to capture the full page. Enable full-page visual regression by comparing against prepared baselines across multiple pages.
Master automated visual regression testing with Selenium and TestNG by taking full-page and element screenshots, comparing images with highlighted differences, and organizing tests with annotations and Maven/XML execution.
"Automated visual testing" is a buzz word in the IT industry nowadays. In this course I would like to show you what it is and how you can significantly benefit from it.
Automated visual testing is a great complement to functional tests. If something works, it does not mean that it looks fine. Moreover, if something is displayed on the page, it does not necessarily mean that it is displayed in the proper place. Here visual regression can help you.
Let me show you a short example.
Usually visual regresison is about comparing two images.
The first one is baseline image. This image is the screenshot of the page when it was thouroughly manually tested and was perfect.
The second one is the current appearance of your page. You can take screenshots on daily basis, for example.
If some visual differences are detected then you get report where detected differences are highlighted in red.
Thus you can be sure that your web site is looking great and user interface is not broken by new development. This kind of testing can significantly enhance overall quality of your products.
I hope you liked an idea of automated visual testing. So welcome to my course!