🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Automation Interview Questions: all 10 questions

Quiz: Automation Interview Questions · Question 8 of 10

In what order do these TestNG annotations run?

In what order do these TestNG annotations run?

  1. A.@BeforeMethod, @BeforeClass, @BeforeSuite
  2. B.@BeforeSuite, @BeforeClass, @BeforeMethod
  3. C.@BeforeClass, @BeforeSuite, @BeforeMethod
  4. D.They run in random order
Answer & explanation

Correct answer: @BeforeSuite, @BeforeClass, @BeforeMethod

Suite, then test, then class, then method: from the widest scope to the narrowest.

Can you get the rest right without peeking?

Take the timed Quiz: Automation Interview Questions quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →