How do we run setup() and teardown() methods once for all the tests in the class for JUnit framework?

Use @Before annotation before all tests and @After after all tests.
Use @BeforeTest annotation before all tests and @AfterTest after all tests.
Use @BeforeClass annotation before all tests and @AfterClass after all tests.
None of the above
Verified Answer
Correct Option - c

To get all Infosys Certified Selenium Basic Automation Tester Exam questions Join Telegram Group https://bit.ly/infy_premium_group

Telegram

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in

Updated on Tue, 1 Jul 2025