What are the Junit Annotations used in Selenium Scripts?

0 votes
Jun 11 in Selenium by Priyanka
19 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Hi Priyanka, there are many annotations available in Junit, but the ones which are used very frequently in Selenium scripts and framework are:

  1. @Test: @Test annotation is used to run a Junit test.

  2. @Before: @Before annotation is used to run any specific test before each test.

  3. @BeforeClass: This method executes once before running all test. Initialization of properties files, databases etc are done in the beforeClass method.

  4. @After: This method executes after each test.

  5. @AfterClass: Like @BeforeClass, @AfterClass executes once after executing all test methods.

  6. Parameterized JUnit class: A parameterized class is used to run the same scenario with multiple datasets.

answered Jun 11 by Maria

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

What are some of the browser commands used in Selenium Webdriver?

Hi Nakul, some of the most frequently ...READ MORE

answered May 14 in Selenium by Abha
• 9,330 points
15 views
0 votes
1 answer

What are the differences between getText() and getAttribute() functions in Selenium WebDriver?

See, both are used to retrieve something ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,050 points
3,880 views
0 votes
1 answer

What is the role of TestNG & JUnit frameworks in Selenium?

Well TestNG and JUnit are test frameworks ...READ MORE

answered Apr 18, 2018 in Selenium by king_kenny
• 3,590 points
149 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,050 points
142 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
532 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
134 views
0 votes
1 answer
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.