🎙 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 9 of 10

What is a TestNG listener used for?

What is a TestNG listener used for?

  1. A.Choosing which browser to open
  2. B.Reacting to test events, such as logging results or taking a screenshot on failure
  3. C.Running SQL queries
  4. D.Replacing assertions
Answer & explanation

Correct answer: Reacting to test events, such as logging results or taking a screenshot on failure

Listeners are registered in testng.xml or with an annotation.

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 →