Both annotations runs before the @test in testNG then what is the difference between two of them.
@BeforeTest
: It will be called Only one time befor any test methods, no matter how many method annotaed with @Test
, it will be called only one time
@BeforeMethod
It will be called befor every methode annotated with @Test
, if you have 10 @Test
methods it will be called 10 times
To know what is the Difference between BeforeClass
and BeforeTest
, please refer to the answer https://stackoverflow.com/a/57052272/1973933