Forum Discussion

sunilbabu's avatar
sunilbabu
Occasional Contributor
8 years ago
Solved

Can I run a specific Test in a keyword test via CMD -TestExecute

I have a keyword test suite wiht 10 individual tests.
Can I run any specific test /Run from specific tests via command line(TestExecute)?

 

Thanks!

 

Sunil

 

  • Oh, I see.,.. you're using the "Run Test" operation.  Well, if you look at those tests, each one matches up to something else... most of them appear to be script units.  In which case you will need to use either the method that karthick7 posted or the one that I posted depending upon the contents of the test.  You can't specifically say "Run the third line of a keyword test" from the command line.

  • Use some if else statement in keyword

     

    if  this = that

    {

    run.test3

    run.test4

    run.test5

     

    }

     

    Please Refer Attached screenshot

12 Replies

  • From Smartbear help document:
    
        The following command runs TestExecute, loads the specified project suite (MySuite.pjs) and tells TestExecute to run the Main script routine located in the Unit1 unit of the MyProj project.
    
        "C:\Work\SmartBear\TestExecute\Bin\TestExecute.exe" "C:\Work\SmartBear\TestExecute\Projects\My\My.pjs" /r /p:MyProj /u:Unit1 /rt:Main
    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      karthick7 wrote:
      From Smartbear help document:
      
          The following command runs TestExecute, loads the specified project suite (MySuite.pjs) and tells TestExecute to run the Main script routine located in the Unit1 unit of the MyProj project.
      
          "C:\Work\SmartBear\TestExecute\Bin\TestExecute.exe" "C:\Work\SmartBear\TestExecute\Projects\My\My.pjs" /r /p:MyProj /u:Unit1 /rt:Main

      That only works for routines that are part of a script unit.  The OP concerns Keyword tests.

       

      To do that, your command line would look like this:


      "C:\Work\SmartBear\TestExecute\Bin\TestExecute.exe" "C:\Work\SmartBear\TestExecute\Projects\My\My.pjs" /r /p:MyProj /test:"KeywordTests|MyTest"

      Where MyTest is the name of the keyword test to be executed.

      • sunilbabu's avatar
        sunilbabu
        Occasional Contributor

        I currently use the above script.

        This command runs my keyword script well and fine, but I wanted to know ,if there is a way to go deeper and run the individual tests in this keyword script

         

        If I have 5 tests in the keyword script and I want to run from the 3rd test.