let's see the code implementation
public class AlwaysRun { WebDriver driver; @Test public void test1() { driver = new FirefoxDriver(); driver.get("http:\\qavalidation.com"); Assert.assertTrue(driver.getTitle().contains("Testing")); } @Test(dependsOnMethods = {"test1"}, alwaysRun=true) public void test2() { driver.findElement(By.linkText("Selenium Tutorial!")).click(); } }
Observe the output, even though test1 did not run, test2 executed.
No comments:
Post a Comment