Applies to TestExecute 14.20, last modified on September 11, 2019

In general, the command line of TestExecute is the same as that of TestComplete:

TestExecute.exe [file_name] [/run 
[
(/project:project_name| (/project:project_name /projectitem:item_name| 
(/project:project_name /test:test_name| 
(/project:project_name /unit:unit_name /routine:routine_name| 
(/project:project_name /tags:tag_expression)] 
[/ErrorLog:file_name] [/exit] [/SilentMode ]  [/ExportLog:file_name] [/ExportSummary:file_Name]
[/Timeout:time_in_seconds]  [/DoNotShowLog]  [/ForceConversion]
[/install:extension_name] [/uninstall:extension_name] [/ns] [/agpatcheroff] [/UsageStatistics:file_name]
[/RestServerPort:port]
[(/ZephyrVersion:version /ZephyrCycle:cycle)] [/DisableExternalReporting]

Note that TestExecute has two executables (32-bit and 64-bit ones):

  • The 32-bit executable of TestExecute is located in the <TestExecute>\Bin\ folder.

  • The 64-bit executable of TestExecute is located in the <TestExecute>\x64\Bin\ folder.

Here the parentheses mean the group of command-line arguments. The “|” means OR, for example, “/r | /run” means you can use either /r OR /run. Square brackets mean the argument or group of arguments is optional. Below is the description of the command-line arguments that TestExecute accepts:

  • file_name - Launches TestExecute and loads the specified project (.mds file) or project suite (.pjs) into it.

  • /run (or /r) - Commands TestExecute to run tests provided by the opened project suite, project, a project item, or a script routine. The action TestExecute will perform depends on what other command-line arguments are specified:

    No other arguments specified

    TestExecute will run the tests provided by the opened project suite.

    /project:project_name

    TestExecute will run all enabled test items of the specified project. Project_name is the name of the project as it is shown in TestComplete Project Explorer panel. You can view the list of test items in TestComplete, on the Test Items page of the project.

    TestExecute will run only the enabled test items, it will not run the disabled items.

    /project:project_name  /projectitem:item_name

    TestExecute will run test(s) provided by the specified project item. You can view project items in the TestComplete Project Explorer panel. Project_name specifies the name of the project that holds the desired project item (use the same name as the name shown in the Project Explorer panel). Item_name is the name of the desired project item.

    Note: Using this argument, you can run only those project items that have the Run item in their context menu. For example, in this way, you can run the Network Suite and ODT project items.

    /project:project_name  /test:test_name

    TestExecute will run the specified test (or tests).

    Project_name specifies the name of the project that holds the needed test (use the same name as that shown in the Project Explorer panel).

    Test_name specifies the test to run. It can be either the full name of the needed test or a tag:

    Full name

    For test items, the full name is specified according to the item hierarchy on the Test Items page of the project, including parent test items and groups. Enclose the test full names in quotation marks. For example:

    "ProjectTestItem1"

    "ProjectTestItem1|ProjectChildTestItem1"

    "Group1|ProjectTestItem1"

    Note: TestExecute executes only those test items that are enabled on the TestComplete Test Items page. The disabled items are not run.

    For individual tests, the full name includes the name of the collection, to which the test belongs, and the test name separated by the pipe character. For script tests, the full name also includes the name of the unit. Enclose your test full names in quotation marks.

    For example:

    "KeywordTests|Test1"

    "LLCollection1|LLP1"

    "ManualTests|ManualTest1"

    "ReadyAPI1|Test1"

    "UnitTesting1|NUnit1"

    "Script|Unit1|Main"

    "NetworkSuite|Jobs|Job1|Job1" (For a network suite’s jobs, the name of the Jobs collection and the name of the job are the same.)

    "NetworkSuite|Jobs|Job1|Task1"

    The test name should not contain names of logical project folders.

    Tag

    To run scripts, keyword tests, or BDD scenarios that match a tag, specify the tag name in the @tag_name format. Enclose the tag in quotation marks. For example:

    "@Tag1"

    To learn how run tests that match a tag expression, use the /tags argument (see below).

    /project:project_name  /unit:unit_name  /routine:routine_name

    TestExecute will run the specified script routine. Project_name specifies the name of the project to which the routine belongs. Unit_name specifies the name of the unit holding the desired routine. Routine_name is the name of the script routine to be called. The routine to be called must not use any parameters and return any value. Project_name and unit_Name should be the same as the project and unit names shown in the Project Explorer.

    /project:project_name  /tags:tag_expression

    TestExecute will run all tests and BDD scenarios of the specified project that match tag_expression.

    Project_name specifies the name of the project that holds the needed tests (use the same name as that shown in the Project Explorer panel).

    Tag_expression specifies the needed tag or tag expression.

    Tag expression syntax

    Note: If the command has both the test and tags arguments specified, the test argument will be ignored.
    If the tags argument specifies an empty tag expression, the command will execute all tagged tests and scenarios of the specified project.

    Notes:

    • Pay attention to the colon between the argument name and the element to which the argument refers. The colon separates the argument name and the element name. Do not insert spaces before or after the colon.

    • The argument names can be shortened. /project can be replaced with /p, /projectitem - with /pi, /unit - with /u and /routine - with /rt.

  • /exit (or /e) - If this argument is used along with the /run argument, TestExecute will close after the project (or project suite) run is over. If the /exit command-line argument is used without /run, then neither the specified project (project) suite will be run, nor will TestExecute be closed.

    Note that if you run tests, the project (or project suite) file will be changed because it will contain a reference to the new log file. TestExecute will display the Confirm dialog asking you to save the changes. To suppress displaying the dialog on exit, specify the /SilentMode command-line argument along with /exit.

  • /ErrorLog:file_name - Commands TestExecute to save information on the errors that occurred during the run to the text file the file_name parameter specifies. This file will include information on the errors that occurred in your tests and on the errors that did not allow opening the project or running the test (for example, an incorrect project path).

    Notes:

    • Important: file_name should specify a non-existent file. If you specify the name of an existing file, TestExecute will fail to run the test.

    • We recommend that file_name specify the fully-qualified file name. If the parameter value does not include the folder path, TestExecute will save the file to the current working folder (by default, it is the project folder) .

  • /SilentMode - If this argument is specified, TestExecute works in silent mode, that is, it neither displays dialogs, nor informs you about errors or warnings. The dialogs and messages to be displayed are handled as if you pressed the default button in them. Information about these dialogs and messages is saved to the following file:

    <Users>\<User_Name>\AppData\Roaming\SmartBear\TestExecute\14.0\Silent.log

    The file should not be read-only or locked by another application.

    The errors that occur during the test run are posted to the test log.

  • /ExportLog:file_name (or /el:file_name) - Commands TestExecute to export test results to a file specified by the File_name parameter after the test run is over.

    Notes:

    • Important: file_name should specify the name of a non-existent file. If it specifies an existing file, TestExecute will fail to run the test.

    • It is recommended that file_name specify the fully-qualified file name. If the parameter value does not include the folder path, TestExecute saves the file to the current working folder (by default, it is the project folder).

    • You can export results to a file in one of the following formats:

      • .mht

      • .tcLogX

      • .html

      • .htm

  • /ExportSummary:file_name (or /es:file_name) - Commands TestExecute to generate a Summary report for the current test run and to save it in the JUnit report format to the XML file that the file_name parameter specifies.

    The report will include the total number of run tests, the number of passed tests and the number of failed tests.

    Notes:

    • If the file_name parameter specifies an existing file, TestExecute will overwrite it.

    • We recommend that the file_name parameter specify the fully-qualified file name. If the parameter value does not include the folder path, TestExecute will save the file to the current working folder (by default, it is the project folder).

  • /Timeout:time_in_seconds - Timeout for the TestExecute session in seconds. This timeout includes both the TestExecute startup time and the test run time. If TestExecute is still running when the timeout elapses, it posts an error to the test log (if a test is running) and closes. Possible values are 30 .. 4 294 967 seconds (49.7 days). If the specified value is out of range, the closest in-range value is used.

  • /DoNotShowLog - If this argument is specified, TestExecute does not show test results automatically after the test run is over. If the argument is not specified, test results are shown in Internet Explorer right after the test has finished.

  • /ForceConversion - If this argument is specified and TestExecute is running in Silent mode, TestExecute automatically converts projects created in earlier versions of the tool to the new format when they are opened.

  • /install:extension_name (or /ip:extension_name) - Installs the specified extension and enables it. Extension_name specifies the fully-qualified name of the desired plugin (.pls file).

    Note: You cannot use this command-line parameter to install a script extension.
  • /uninstall:extension_name (or /up:extension_name) - Uninstalls the specified extension. Extension_name specifies the fully-qualified name of the plugin (.pls file) that corresponds to the extension you want to uninstall.

    Notes:

    • This command does not delete the actual file from the disk.

    • You cannot use this command-line parameter to uninstall a script extension.

  • /ns - Starts TestExecute without displaying the “TestExecute has started” taskbar notification.
  • /agpatcheroff - Disables auto-patching of Silverlight applications. To learn more about Silverlight auto-patching, refer to the TestComplete documentation.

  • /UsageStatistics:file_name (or /US:file_name) - Commands TestExecute to collect statistics on usage of Name Mapping items during test runs. TestExecute will save the gathered data to the specified file. You can then use this data to find and remove unused objects to clear the Name Mapping repository. To learn how to do it, see TestComplete documentation.

    If the file name includes spaces, enclose it in quotes:

    TestExecute.exe /UsageStatistics:"c:\some shared folder\Name Mapping Data.stat"
  • /RestServerPort:port - If the REST API plugin is installed and enabled in TestExecute, it commands the TestExecute RESTful service to use the specified port. Otherwise, the service will use the default port - 2377.

    Note: If a firewall or an antivirus is running on your computer, make sure that it allows traffic through the specified port.
  • /ZephyrVersion:version - If test items of your TestComplete project are bound to Zephyr tests in your Jira project, this argument specifies the release version of your Jira project to which test results will be added.

    You can use this argument only if you have TestExecute version 14.10 or later.

  • /ZephyrCycle:cycle - If test items of your TestComplete project are bound to Zephyr tests in your Jira project, this argument specifies the test cycle in your Jira project to which test results will be added.

    You can use this argument only if you have TestExecute version 14.10 or later.

  • /DisableExternalReporting - Disables sending test results to external test management systems (for instance, Zephyr for Jira).

Note: If neither the release version, nor test cycle are specified, TestExecute will send test results to the release version and test cycle that your project settings specify. If the project settings do not specify the version and release either, TestExecute will send the test results to a default release version (Unscheduled ) and to a default test cycle (Ad hoc).

Examples

Here are some examples of running TestExecute with command-line arguments:

  • The following command runs TestExecute, loads the specified project suite (MySuite.pjs) and tells TestExecute to run test items of the MyProj project.

    TestExecute.exe "C:\Work\SmartBear\TestExecute\Projects\My\MySuite.pjs" /r /p:MyProj

  • The following command runs TestExecute, loads the specified project suite (MySuite.pjs) and tells TestExecute to run all its projects that are enabled. TestExecute waits until the run is over and then gets closed.

    TestExecute.exe "C:\Work\SmartBear\TestExecute\Projects\My\My.pjs" /r /e

  • The following command runs TestExecute, loads the specified project suite (MySuite.pjs) and commands TestExecute to run the Test1 keyword test of the MyProj project.

    TestExecute.exe "C:\Work\SmartBear\TestExecute\Projects\My\MySuite.pjs" /r /p:MyProj /t:"KeywordTests|Test1"

  • The following command runs TestExecute, loads the specified project suite (MySuite.pjs), and commands TestExecute to run the MyProj project’s tests that match the Tag1 tag.

    TestExecute.exe "C:\Work\SmartBear\TestExecute\Projects\My\MySuite.pjs" /r /p:MyProj /t:"@Tag1"

  • The following command runs TestExecute, loads the specified project suite (MySuite.pjs), and commands TestExecute to run the MyProj project’s tests that match the specified tag expression.

    TestExecute.exe "C:\Work\SmartBear\TestExecute\Projects\My\MySuite.pjs" /r /p:MyProj /tags:"@tag1 or (@tag2 and @tag2)"

  • 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.

    TestExecute.exe "C:\Work\SmartBear\TestExecute\Projects\My\My.pjs" /r /p:MyProj /u:Unit1 /rt:Main

  • The following command runs TestExecute, loads the MySuite.pjs project suite, and commands TestExecute to run the Task1 task of the network suite’s Job1 job in the MyProj project:

    TestExecute.exe "C:\Work\My Projects\MySuite.pjs" /r /p:MyProj /t:"NetworkSuite|Jobs|Job1|Task1"

  • The following command runs TestExecute, loads the MySuite.pjs project suite, and commands TestExecute to run the Job1 job in the MyProj project’s network suite:

    TestExecute.exe "C:\Work\My Projects\MySuite.pjs" /r /p:MyProj /t:"NetworkSuite|Jobs|Job1|Job1"

    The name of the Jobs collection is the same as the job’s name (Job1).

  • The following command runs TestExecute, loads the MySuite.pjs project suite, commands TestExecute to execute test items of the MyProj project and to send their test results to the Regression test cycle of the 2.1 version of the Jira project bound to the MyProj project:

    TestExecute.exe "C:\Work\My Projects\MySuite.pjs" /r /p:MyProj /ZephyrVersion:2.1 /ZephyrCycle:Regression

Note: TestExecute waits until the specified project suite, project, test and so on is executed in all the examples above. However, the command line is ready to receive new commands right after TestExecute has been launched.

If you want the command line to wait until the test (project and so on) execution is over, you can use the START command, for example.

start /wait "TestExecute" TestExecute.exe "C:\Work\My Projects\MySuite.pjs" /run /exit /SilentMode

Remarks

  • To determine which parameters were passed to TestExecute in its command line, you can use the ParamStr and ParamCount functions.

  • TestExecute cannot run tests in CrossBrowserTesting.com environments. To run these tests, use TestComplete. To learn more, see the TestComplete documentation.

See Also

TestExecute Exit Codes

Highlight search results