Consider a scenario where you have two @Test annotations in your class for each of the below methods :
a) Login
b) CheckMail

Now due to the some reasons (Invalid credentials), @Test Login method fails. Now how can we skip executing the @Test CheckMail method when login fails (Since CheckMail method can be executed only after Login method is success).

@Test(priority=1,enabled=false) public void CheckMail(){ }
@Test(priority=2,enabled=false) public void CheckMail(){ }
@Test(priority=1,dependsOnMethods={"Login"}) public void CheckMail(){ }
. @Test(priority=2,dependsOnMethods={"Login"}) public void CheckMail(){ }
Verified Answer
Correct Option - d

To get all Infosys Certified Selenium Advance Automation Tester Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram