← 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?
- A.@BeforeMethod, @BeforeClass, @BeforeSuite
- B.@BeforeSuite, @BeforeClass, @BeforeMethod
- C.@BeforeClass, @BeforeSuite, @BeforeMethod
- 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 →