How to create Dependency with classes across suites files

620 views
Skip to first unread message

subbu

unread,
Aug 31, 2009, 10:38:13 AM8/31/09
to testng-users
Hello,

I got a requirement where in i need to run a common Group A.(test in a
separate xml,common.xml) There are other modules in the project which
should run their testcases depending on success of Group A.

Each modules have their tests in separate testng xmls.

All tests are triggered from one xml (integration.xml).I have
mentioned all teh module level testng.xml in suitefiles tag.

I am trying to run module testcases but i am getting Exception (cannot
depend on nonexistent group "A"
... Removed 15 stack frames)

To summarize
-----------------------------------
Group A -- in common.xml
Module 1-- depends on Group A and in module1.xml
Module 2- depends on Group A and in module 2.xml

Integration.xml
(included all xmls in suitefiles tag)


Can somebody please provide any help ?

Thanks in advance

Cédric Beust ♔

unread,
Aug 31, 2009, 10:44:59 AM8/31/09
to testng...@googlegroups.com
If TestNG cannot find a certain group, it's because none of the methods/classes that you specified in your testng.xml belong to that group.  Can you double check that?

--
Cedric
--
Cédric


subbu

unread,
Aug 31, 2009, 11:16:12 AM8/31/09
to testng-users
Hi Cedric

Thanks for your response.

Please find the testng.xml that i am using and where i am creating
dependency with the common group A

Module1.xml
-----------------------------------
<suite name="Module1" verbose="1" >
<test name="PortTest" >
<classes>
<class name="com.testng.test.PreRequisiteTest" />
<class name="com.test.PortFencingBeanTest" />

</classes>
<groups>

<run>
<include name="PortFencing" />
</run>

</groups>


</test>
</suite>
-------------------------------------
PreRequisiteTest-- has Group A.(this Group is run through common.xml
testng file)
PortFencingBeanTest - has tests which dependsOnGroups= A.
But when i run the test i get cannot depend on nonexistent group "A"

Please let me know what could be the problem here...

Thanks in Advance...
> ***Cédric
> *- Hide quoted text -
>
> - Show quoted text -

Cédric Beust ♔

unread,
Aug 31, 2009, 11:25:39 AM8/31/09
to testng...@googlegroups.com


On Mon, Aug 31, 2009 at 8:16 AM, subbu <palive...@yahoo.com> wrote:
          <run>
       <include name="PortFencing"  />
       </run>

This is telling TestNG you only want methods that belong to this group, so methods that belong to group "A" and not in "PortFencing" won't be considered.

--
Cédric


Reply all
Reply to author
Forward
0 new messages