Forum Discussion

Renuka's avatar
Renuka
Occasional Contributor
7 years ago

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

  • lakshmiarun's avatar
    lakshmiarun
    SmartBear Alumni (Retired)

    Hi,

     

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

     

    Best,

    Lakshmi

  • Renuka's avatar
    Renuka
    Occasional Contributor

    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.