Q. What is the purpose of @AfterMethod in TestNG?

A
To set up data
B
To run cleanup after each test
C
To define a test
D
To generate a report
Solution:

@AfterMethod executes teardown code (e.g., closing browsers) after each test method.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!