Forum Discussion

howie_'s avatar
howie_
Contributor
11 years ago

Running individual Test Items in TestExecute

Hey Everyone, 



I'm trying to re-run a single test item within my test project, and I can't quite figure out how. The test project has 15 or so test items, so being able to run only the 1 item necessary would be a huge help. I think my best bet is the commandline utility, but I haven't been able to get it to work just yet. Here's what I'm using: 





TestExecute.exe "<path to .pjs>" /project:"<TestProject>" /test:"<TestItem>" /run /exit





when I run this command I get an error that "TestItem could not be found in project TestProject". I should mention that these are scripted tests, not keyword tests. 



I'd appreciate any advice you guys could offer. 





Thanks, 

Howie 







5 Replies

  • rgratis's avatar
    rgratis
    Frequent Contributor
    I believe for script routines, the format for /test is:

    /test:"Script|<name-of-unit>|<name-of-routine>"



    You can also not use /test and instead do:

    /unit:<name-of-unit>  /routine:<name-of-routine>
  • Thanks for the reply, I appreciate it. Can you clarify one thing for me? What do you mean by "routine"? Are you talking about the actual function within the script? 



    I think one of the problems that I have is that structure of my test items. For instance, one test items might include between 5 and 15 child test items that each need to be run in order. Would I need to to do something like this: 



    /unit:"TestItem1" /routine:"ChildItem1"

    ...

    /unit:"TestItem1" /routine:"ChildItem15"



    or 



    /unit:"TestUnit1" /routine:"FunctionName1"

    ...

    /unit:"TestUnit1" /routine: "FunctionName15"
  • jorgesimoes1983's avatar
    jorgesimoes1983
    Regular Contributor
    For my tests, I created a bat file, then run it with something like this:



    "C:\Program Files (x86)\SmartBear\TestExecute 9\Bin\TestExecute.exe" "C:\SVN TestComplete\ProjectSuiteMASTER\Tests.mds" /run /p:Tests /t:"KeywordTests|test_one" /exit
  • tandreys's avatar
    tandreys
    Occasional Contributor
    Unless there is a change in TC10, you cannot specify testitem on the command line.

    The only way I found, is throught COM using 'IntegrationObject.RunProjectTestItem'. You can find an example of use of COM in TestExecute help.