Hi Priyanka, there are many annotations available in Junit, but the ones which are used very frequently in Selenium scripts and framework are:
-
@Test: @Test annotation is used to run a Junit test.
-
@Before: @Before annotation is used to run any specific test before each test.
-
@BeforeClass: This method executes once before running all test. Initialization of properties files, databases etc are done in the beforeClass method.
-
@After: This method executes after each test.
-
@AfterClass: Like @BeforeClass, @AfterClass executes once after executing all test methods.
-
Parameterized JUnit class: A parameterized class is used to run the same scenario with multiple datasets.