← Quiz: TestNG: all 10 questions
Quiz: TestNG · Question 1 of 10
Which annotation runs before EVERY test method?
Which annotation runs before EVERY test method?
- A.@BeforeSuite
- B.@BeforeClass
- C.@BeforeMethod
- D.@BeforeGroups
Answer & explanation
Correct answer: @BeforeMethod
@BeforeClass runs once per class.
Can you get the rest right without peeking?
Take the timed Quiz: TestNG quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →