TestNG Annotation is a piece of code which is inserted inside a program or business logic used to control the flow of execution of test methods Lets go through few TestNG annotation Some Basic TestNG annotation @Before suite @BeforeClass @BeforeMethod @BeforeTest @Test @AfterTest @AfterMethod @AfterClass @AfterSuite @BeforeSuite You can validate them by writing the below code public void setup(){ System. out .println( "Before suite" ); } @BeforeClass public void LaunchBrowser(){ System. out .println( "Before class" ); } @BeforeMethod public void EnterUrl(){ System. out .println( "Before Method" ); } @BeforeTest public void Login(){ System. out .println( "Before Test" ); } Priority and Groups //priority and groups are keyword give to @test to prioritise which test annotation should be run first priority 1 will run first then second and third so on Keyword group will create title in index.html and the test case wi...
A home for beginners in the domain of Software Testing. Join in the journal to learn from experiences earned the hard way