Making a class dependent on other class using TestNG xml

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Making a class dependent on other class using TestNG xml

Anurag-2
Hello 

We are facing an issue where while specifying dependency in TestNG xml the dependent test class runs but  the depended test don't run once the dependent tests execution is complete 

We are running test suites in parallel however there are certain tests which conflict with tests in other class and cause test failures. So we are looking a way to mark a test class - test1 dependent on another test class - test2 using TestNG xml. So that tests in test1 will only execute once tests in test2 are executed (We are not bothered about the results of test2) 

Can someone provide thoughts what could be the issue? 

Following is the xml we have created using xml based dependency 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="UI tests" verbose="2" parallel="tests">
<listeners>
<listener class-name="listeners.LogListener"/>
</listeners>

<test name="test1" group-by-instances="true" preserve-order="true">
<groups>
<dependencies>
<group name="test1 test" depends-on="test2 test" />
</dependencies>
</groups>
<classes>
<class name="Test.Test1"/>
</classes>
</test>
<test name="test2" group-by-instances="true" preserve-order="true">

<classes>
<class name="Test.Test2"></class>
</classes>
</test>

</suite>

Here are the test classes 

@Test(groups = {"test1 test"})
public class Test1 extends TestBase {

@Test
public void Test123() {
}
}

@Test(groups = {"test2 test"})
public class Test2 extends TestBase {

@Test
public void TestABC() {
}
}

Thanks,
Anurag

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.