Skip to content
Advertisement

what is execution order of TestNG?

Parent class has @BeforeClass. Child class has @BeforeClass and @Test. What is an execution order? What is execution order if @BeforeClass methods’ names in both classes are the same?

Advertisement

Answer

First @BeforeClass in parent class is executed, then @BeforeClass in child class. If @BeforeClass name is the same in parent and child class, then you are just overriding the method so only child class @BeforeClass is executed.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement