more than one test element in testng.xml

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

more than one test element in testng.xml

ptsks

Hi,
I have only one Test Class with several test methods which belong to
several groups and some depend of other groups or methods.
 i want to invoke groups in a particular order

1. installGroup
2. operateGroup
3 uninstallGroup

one of method in installGroup needs params. So when i execute the test
class passing parameters is required. But i do not want to pass that
parameter when executing operateGrop (BTest below)..
1) is there any way i can avoid passing parameter when running BTest..
2) I want to call the ATest groups one of the method which needs
params, twice with different params..how can i specify params and
guarantee that the method is called twice in the same group. I tried
duplicating the param statement with different values but only the
last one got executed.

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite1" verbose="1">
<test name="Atest">
        <groups>
                <define name="first">
                        <include name="groupOne"/>
                        <include name="groupTwo"/>
                </define>
                <run>
                        <include name="first"/>
                </run>
        </groups>
        <classes>
                <class name="com.xyz.ABCTest">
                        <parameter name="compName" value="bc1.zip"/>
                </class>
        </classes>
</test>

<test name="Btest">
        <groups>
                <define name="second">
                        <include name="secGr"/>
                </define>
                <run>
                        <include name="second"/>
                </run>
        </groups>
        <classes>
                <class name="com.sxyz.ABCTest"/>
        </classes>
</test>

</suite>

I am using ant to invoke the testng task and have set the
suitename...to this Suite's name "Suite1"


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: more than one test element in testng.xml

Alexandru Popescu ☀

On 4/24/07, ptsks <[hidden email]> wrote:

>
> Hi,
> I have only one Test Class with several test methods which belong to
> several groups and some depend of other groups or methods.
>  i want to invoke groups in a particular order
>
> 1. installGroup
> 2. operateGroup
> 3 uninstallGroup
>
> one of method in installGroup needs params. So when i execute the test
> class passing parameters is required. But i do not want to pass that
> parameter when executing operateGrop (BTest below)..
> 1) is there any way i can avoid passing parameter when running BTest..
> 2) I want to call the ATest groups one of the method which needs
> params, twice with different params..how can i specify params and
> guarantee that the method is called twice in the same group. I tried
> duplicating the param statement with different values but only the
> last one got executed.
>
> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
> <suite name="Suite1" verbose="1">
> <test name="Atest">
>         <groups>
>                 <define name="first">
>                         <include name="groupOne"/>
>                         <include name="groupTwo"/>
>                 </define>
>                 <run>
>                         <include name="first"/>
>                 </run>
>         </groups>
>         <classes>
>                 <class name="com.xyz.ABCTest">
>                         <parameter name="compName" value="bc1.zip"/>
>                 </class>
>         </classes>
> </test>
>
> <test name="Btest">
>         <groups>
>                 <define name="second">
>                         <include name="secGr"/>
>                 </define>
>                 <run>
>                         <include name="second"/>
>                 </run>
>         </groups>
>         <classes>
>                 <class name="com.sxyz.ABCTest"/>
>         </classes>
> </test>
>
> </suite>
>
> I am using ant to invoke the testng task and have set the
> suitename...to this Suite's name "Suite1"
>

Hi,

In order to be able to answer your questions or give some hints I will
need more information, code snippets, etc. The above example if
completely different than what you describe in words, so there is not
much I can do.

I would also recommend you to read the online documentation:
http://testng.org/doc/documentation-main.html (with a focus on the 5.5
Parameters, 5.6 Depedent methods).

bests,

./alex
--
.w( the_mindstorm )p.
  TestNG co-founder
EclipseTestNG Creator

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---