TestNG Execution Hierarchy
TestNG follows following execution hierarchy.
- Suite
- Test
- Class
- Method
Take a quick look at practical application of TestNG Annotation on Eclipse IDE
Examples:
Lets explore the use case in various conditions
Condition 1 >> I want to open my chrome browser once before all the @test from a class
= In this case I will write the selenium code to open the chrome browser in @BeforeClass method
Condition 2 >> I want to open an specific URL before each test from a class
= In this case I will write the selenium code to open the URL in @Beforemethod
Comments
Post a Comment