Forum Discussion

marinb's avatar
marinb
Contributor
7 years ago

How to run a specific test item in TestExecute

I was wondering how I can run a specific function in TestExecute. This is a workaround to the lacking functionality that you cannot execute specific test item groups (why oh why? What is the purpose anyway to be able to structure your tests like that if you can't run them?).

The help file states you have to use the following parameters:
/project:project_name  /test:test_name


For the /test parameter, the following example is given:
/t:"Script|Unit1|Main"

 

So, in my case (screenshot below), I expect the command to be:

/p:AccessControl_FE /t:"Script|TestCases|smokeTest|Test"

 

 

 

However, this not work. Error 'Invalid command line. The test 'Script|TestCases|smokeTest|Test' was not found in the project 'AccessControl_FE'

 

What am I doing wrong here? (And why can't you simple use /test:Group1 if you have multiple test item groups defined)

 

 

 

8 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    The "TestCases" folder is not actually part of the project structure.  Folders in either the Script section or the Keyword Tests section are simply logical organization and don't actually play a part in determining that the test is run.  As per the help:

    "The full name of a test should not contain the name of the Advanced folder or names of other logical project folders."

     

    So, in your case, the command line is

     

    /p:AccessControl_FE /t:"Script|smokeTest|Test"

     

    Alternatively, you could do the following, using unit name and routine name switches.

     

    /p:AccessControl_FE /u:smokeTest /rt:Test

     

    As for the "Groups" in the test items... same thing... they are, for the most part, just organization.  If you want to run a group, I think a workaround would be to create a test item that is not a group that contains the group and simply execute it.  Something like


     

    Your command line could then be 

     

    /project:project_name  /test: PlaceHolder

    • marinb's avatar
      marinb
      Contributor

      /project:AccessControl_FE  /test: DEV_AccessControl_FrontEnd

       

      results in 'The test DEV_AccessControl_FrontEnd' was not found in the project ' AccessControl_FE'

       

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Double check your command line... there should be no space between the colon and the test item name.
    • marinb's avatar
      marinb
      Contributor

      Sorry, my bad. The original line does not have it (ugh, smileyface proves it hehe):

       

      "C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\TestExecute.exe" "D:\_work\r3\a\AccessControl.FrontEnd\TestScript\AccessControl\AccessControl.pjs" /r /p:AccessControl_FE /test:DEV_AccessControl_FrontEnd /e /exportLog:"C:\Temp\Log_FE.mht"

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Another dumb question I know... perhaps 2 dumb questions.

        1) The screenshot shows the project in the editor of TestComplete.  Is your attempt to run in TestExecute on the same machine as that screenshot or a different machine?

        2) If it's on a different machine, can you verify that you have the latest copy of the MDS file on that second machine?  The MDS is the file that stores those test items.