JUnit Annotations in Selenium

JUnit is a Java-based, open-source framework to help you execute unit testing. JUnit is used primarily to test each and every unit or component of your application, like classes and methods. It helps to write and run repeatable automated tests to ensure your code runs as intended. The framework offers support to Selenium for automation testing for web apps or websites.

This article is my attempt to help you use JUnit annotations in Selenium as a professional tester would. We would be looking at examples of JUnit annotations in Selenium, their order of execution, along with some special JUnit annotations that are used for a specific purpose. We will also be looking into a collective code for executing each example of JUnit annotations in Selenium.