Hi,
it depends on your build tool and the source of your variable. With
Maven you could achive this by using different profiles. For that have a
look at possibilites for the activation of a Maven profile (system
property, environment variable).
Or have a look at the different listeners provided by the TestNG API.
There is a listener which can modify a suite programmatically.
Sorry I can't provide any links, since I am offline while writing this.
Bye,
Oliver
Am 25.04.2013 11:44, schrieb 孙岳:
> Hi,
> I am using TestNG 6.7 and have such requirements: I need run some tests
> in a certain condition, and skip these tests if this condition doesn't
> exist.
> Say a suite xml as following:
>
> <suite name="condition">
> <if condition="${variable}">
> <test name="test-1">
> <classes>
> <class name="sample.SampleTest"/>
> </classes>
> </test>
> </if>
> </suite>
>
> When the "variable" is true, "test-1" will be executed, otherwise
> "test-1" will be skipped. (I use an inexistent "if" tag to express my
> requirement)
> Can testng support it?
> Thank you.
>
> --
> 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
testng-users...@googlegroups.com.
> To post to this group, send email to
testng...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/testng-users?hl=en.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>