java - How to execute second test case if the first fails using selenium -
supposing code
webdriver dr = new firefoxdriver(); @test(prioity =1) { dr.findelement(by.id("element1_id")).click(); } @test(prioity =2) { dr.findelement(by.id("element2_id")).click(); }
if dr.findelement(by.id("element1_id")).click();
throws exception how not stop execution of second test case afterward?
if you're using testng, can use parameter alwaysrun.
@test(priority = 1, alwaysrun = true)
this execute method regardless of happens in other tests (or configuration methods, watch out!)
Comments
Post a Comment