cancel
Showing results for 
Search instead for 
Did you mean: 

Execute tests based on different tags

Renuka
Occasional Contributor

Execute tests based on different tags

I want to run all tests which belong to multiple tags from command line. For example I want to run tests which have tag X and Z. So I used below command:

cmd.exe /C testrunner.bat -r -j "-fC:/Reports" "-RProject Report" "-Edefault" "-TTestCase X,Y" "C:\Dummy.xml"

 

TagX
Test1
Test2
Test3

 

TagY
Test4
Test5

Test6

 

TagZ

Test7

Test8

Test9

 

But running above command give me failure and show no test executed.
can anyone please help me to run tests of different tags altogether?

2 REPLIES 2
lakshmiarun
Staff

Re: Execute tests based on different tags

Hi,

 

Thank you for posting in our forum. Could you please try -T"TestCase X,Y" instead of "-TTestCase X,Y"?

 

Best,

Lakshmi

-------------Lakshmi

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Renuka
Occasional Contributor

Re: Execute tests based on different tags

I want to run tests which have tags either X OR Z , but the command which I was using can run only those tests which have tags both X AND Z :
cmd.exe /C testrunner.bat -r -j "-fC:/Reports" "-RProject Report" "-Edefault" "-TTestCase X,Y" "C:\Dummy.xml"

in that way my purpose won't solve.


I got one solution to run tests that have tags either X OR Z  by running the project two times: 
testrunner.bat -r "-RProject Report" -EDefault "-TTestCase X" ".......\XYZ\xyz.xml" testrunner.bat -r "-RProject Report" -EDefault "-TTestCase Y" ".......\XYZ\xyz.xml"

The disadvantage of this :- the report which is generated for 1st project (having tags X) is overwrite by the 2nd project(having tag Y). By which we will not get total count of both tests.


 

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors