Chapter 4
TestNG XML File
Instructor: Rex Jones II
Chapter 4
▪ View xml File For TestNG Suite, Test, Class, & Method Tags
▪ Decide Which TestNG Annotations We Choose For Testing
View xml File For
TestNG Tags
Which Annotation(s)
Do We Choose For Testing
TestNG Annotations
Annotations Description
@BeforeSuite Annotates methods that will be run before any method in a
given <suite> is run
@AfterSuite Annotates methods that will be run after all the test
methods in a given <suite> have been run
@BeforeTest Annotates methods that will be run before any method in a
given <test> is run
@AfterTest Annotates methods that will be run after all the test
methods in a given <test> have been run
@BeforeClass Annotates methods that will be run before the first method
on the current test class is run
@AfterClass Annotates methods that will be run after the last test
method on the current class is run
@BeforeMethod Annotates methods that will be run before each test
method
@AfterMethod Annotates methods that will be run after every test method
@Test Annotates a method as a test method
Reference Links
▪ Next Generation Java Testing TestNG and Advanced
Concepts
[Link]
▪ Getting Started With TestNG (A Java Test Framework)
[Link]