Question: what is the difference between before class and before test in testng?
Answer: As we know from official TestNG documentation: @BeforeClass: The annotated method will be run before the first test method in the current class is invoked. @BeforeTest: The annotated method will be run before any test method belonging to the classes inside the <test> tag is run.