views:

23

answers:

1

Hey Guys,

Here is the scenario:

Have a shell script that calls ant with one argument. The ant in turn executes testng.xml (suite file) passing the same argument and testng in turn executes the test within passing the same argument.

In my case, I am passing the browser string eg.(firefox, iexplore) argument that will specify which browser test will run on. I want to be able to have my test result output tell me which browser the test run in.

I grab the argument from command line in ant by so:

...

<sysproperty key="browser" value="${browser}"/>

I was thinking that since ant calls testng.xml, i can do the same in testng.xml

I went to testng.xml and did something like:

<suite name="AcceptanceSuite_${browser}">
<test name="Acceptance Test_${browser}" >

I hope i didnt lose anybody. Not the best in explaining things but simply need away of capturing this argument in testng.xml and including that in the suite name

A: 

I think it should work with <sysproperty> if you set delegateCommandSystemProperties to true and nest the <sysproperty> within <testng>

Not sure if you have nested the <sysproperty> ?

JoseK
hello can you please give an example of what you mean and where to include this option. Do you mean in the ant file (build.xml) or the suite file (testng.xml). How? Remember that i want to access this property in testng.xml file
Afamee
see the link in my answer. this setting goes in testng.xml
JoseK