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

A
To run cleanup after each test
B
To execute setup before each test method
C
To define a test
D
To generate a report
Solution:

@BeforeMethod runs setup code (e.g., opening a browser) before each test method.

Entri Contact Image

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