To Run multiple test Using testng.xml please refer: https://www.mkyong.com/unittest/testng-tutorial-5-suite-test/
Run Test on environment
To run test verifying the operating system we can use this type segment.
in java file
@Test
public class Test1 {
@Test(groups = { "windows.checkintest" })
public void testWindowsOnly() {
}
@Test(groups = {"linux.checkintest"} )
public void testLinuxOnly() {
}
@Test(groups = { "windows.functest" )
public void testWindowsToo() {
}
}
in xml
<test name="Test1">
<include name="windows.*"/> |
<class name="example1.Test1"/> |
</test>
More refer : http://testng.org/doc/documentation-main.html
Test Dependency
Creating the dependency among @test use
@Test(dependsOnMethods = { "testName" })
For more refer:
https://www.tutorialspoint.com/testng/testng_dependency_test.htm
https://dzone.com/articles/testng-depedency-test-%E2%80%93
Comments
Post a Comment