🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.@BeforeSuite
  2. B.@BeforeClass
  3. C.@BeforeMethod
  4. 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 →