Forum Discussion

Josh_147's avatar
Josh_147
Contributor
4 years ago
Solved

Invalid Command Line to Run Test Item

Hi all,

 

I'm trying to use the command line to run individual test items by using .bat file. I created a project suite and tried the examples provided at here . 

 

This is the project I created.

 

These 2 examples work fine,

TestComplete.exe "C:\My Projects\MySuite.pjs" /r /p:MyProj

TestComplete.exe "C:\Work\My Projects\MySuite.pjs" /r /e

 

but for the example to run test items, it always show 'Invalid command line' error.

TestComplete.exe "C:\Work\My Projects\MySuite.pjs" /r /p:MyProj /t:"ProjectTestItem1|ProjectTestItem2|ProjectTestItem3"

 

 

I went through the discussion but it looks like the accepted solutions are not the same as the examples provided in the documentation.

 

For example, I want to run ProjectTestItem1 and ProjectTestItem4 only. So, is there any solution to run these 2 test items only by using the method provided in documentation instead of this method?

  • Thank you for helping Wamboo!

     

    Josh_147 could you let me know if there's a reason why you are staying on the older TestComplete version? (v.11)? I apologize if I missed that. However, I strongly recommend using the latest one, since our team keeps adding new features and improving the tool. Please try updating the tool and let us know if this helps. 

    If it doesn't, please try contacting the Support Team.

9 Replies

  • Wamboo's avatar
    Wamboo
    Community Hero

    Hi, With these pipes "|" you tell TextComplete to look like a nested testItems, i.e. TestComplete thinks you want to run something like this:

     

    ProjectTestItem1|

          ProjectTestItem2|

                ProjectTestItem3

    not on one list.

     

    In my opinion there is no possibility to run for example two testItems out of 5 available. What you can do is to group it into folders or nested testItem's.

    Another consideration is to run the whole project and leave on the testItems list only the active ones we want to run.

    • Josh_147's avatar
      Josh_147
      Contributor

      I think the method that grouping or nested the TestItems had tried before at here . But I also try again to grouping or nested them, the results are the same, failed.

       

      The purpose is to allow those users that who are not familiar with TC can run the individual TestItems without running TC and making any changes in the workspace (check or uncheck the TestItems' checkbox).

       

      Seems like Run an individual test item via command line is the only way to achieve the goal? But I have tried to run the command (paths edited accordingly), it always prompt out the error message: Cannot start TestComplete. Exiting...

       

      C:\ATR.js TestComplete "C:\Users\<Your_User_Name>\Documents\TestComplete 9 Projects\TestProjectTestForRunFromCommandLine\TestProjectTestForRunFromCommandLine.pjs" /p:TestProjectTestForRunFromCommandLine /t:ProjectTestItem1

       

      Anything that I missed out or need to edit something before using the ATR.js?

      • Josh_147's avatar
        Josh_147
        Contributor

        I found this discussion and it is what I'm really looking for. But the latest update stated that: This functionality has been implemented in TestComplete 12.40.

         

        Since I'm using TC 11, is it the reason that I failed to use the command line to run the testing?