vendredi 3 août 2018

Error when calling dependency of one method of another class into other class in TestNG automation

I want to add dependency of one test method from class A to another testMethod in class B. Whenever I am running method "testTwo()" from class B I am getting error as "method B.testTwo() depends on nonexistent group A.Group1" , my class structure is as below .

public class A
{
  @Test(groups={"A.Group1"})
   public void testOne(){}
}
public class B
{
  @Test(dependsOnGroups={"A.Group1"})
   public void testTwo(){}
}

Can anyone please guide here ?,

also My test.xml looks like below

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="TEST-AUTOMATION" thread-count="1"
        preserve-order="true" data-provider-thread-count="1">

    <test name="TESTS">
        <classes>
            <class name="A"/>
            <class name="B"/>
        </classes>
    </test>

</suite>

Aucun commentaire:

Enregistrer un commentaire