java - TestNG - dependency between 2 Classes (dependsOnGroups) -
i'm creating testng.xml programatically , running tests in parallel.
the issue is: - need run test2 after test1
i tried using 'dependsongroup' assigning test1 group , asking test2 dependon test1's group. when run test suite, test1 executed, test2 skipped. no errors reported.
@test(groups = {"firsttest"}) public class test1 { public void hello(){ syso("test1"); } } @test(groups = {"secondtest"}, dependsongroups= {"firsttest"}, alwaysrun=true) public class test2 { public void hi(){ syso("test2"); } }
i'm using testng.6.9.6.jar
adding priority need. @test(priority=1)
. lower priority execute first.
@test(priority=1) public class test1 { public void hello(){ syso("test1"); } } @test(priority=2) public class test2 { public void hi(){ syso("test2"); } }
it first run test1 , test2. whichever classes put in test suite, consider priorities of test functions in it's classes.
should needful in lesser complicated way.
i hope helps. :)
Comments
Post a Comment