Command-Line Commands
In order to execute test scripts from the command line, the command-line command <directory>CODESYS.exe
is provided with the parameters below. Parameters that are used with arguments have delimited the added argument with "="
or ":"
.
Example:
C:\Program Files (x86)\3S CODESYS\CODESYS\Common\CODESYS.exe --profile="CODESYS V3.5 SP13" --executecommand="TestManager ExecuteScript" --arg1:"--repository-name=ABC" --arg2:"--script=SaveBootProject" --arg3:"--version=1.0" --arg4:"--tester=autobuild" –arg5:"--store"
Tip
Include arguments which contain spaces, minus signs, or slashes enclosed by straight quotation marks: "<argument>"
.
Tip
You can also click Copy command line to clipboard to generate the command.
Parameter: --executecommand="TestManager ExecuteScript"
The parameter starts the execution of a test script, without opening CODESYS. To do this, the parameter needs at least one argument (--arg<X>:"<parameter>"
) which then passes one of the following parameters. For example, to pass the file path of the started test script.
| Command-line argument to pass one of the following parameters The argument is always enclosed by straight quotation marks. |
Parameter | |
---|---|
| Absolute location of the test repository Example: |
| Name of the test repository in the Test Manager as you have created the test repository in the Edit Repository Locations dialog Example: Note: Alternatives to the parameter |
| Path (folder and name) of the script within the test repository The hierarchical folders are separated by a period. Example: |
| Version of the test script Optional If you do not specify a version, then the newest version of the test script is used automatically. Example: |
| Name of the tester Example: |
| Target path of the report in XML format Optional Example: Hint: We recommend that you specify at least one of the |
| Target path of the report in HTML format Optional Example: Hint: We recommend that you specify at least one of the |
| Saves the test report internally in the test repository Optional Hint: We recommend that you specify at least one of the |
| Name of the report in order not to save the report as the default name Optional Example: |
| Overwrites existing files Optional as additional parameter for |
| Displays the progress of the test run as a data stream The parameter needs at least one argument. A semicolon ( . Arguments
Example: |
| The test report is reduced. The values of variables are not included in the test report when the following test elements are run: assignment, test script call, test action, choose (conditions). |
--arg1:"--repository-location=D:\Testrepository_1" –-arg2:"—script=foo/bar" –-arg3:"—version=1.2.3.0" --arg4:"--progress=stdout;window"
Option: --exitafterexecutecommand
The option automatically closes CODESYS after executing a test script.
When the option is set, an exit code is returned.
C:\Program Files (x86)\3S CODESYS\CODESYS\Common\CoDeSys.exe --profile="CODESYS V3.5 SP3" --exitafterexecutecommand --executecommand="TestManager ExecuteScript" --arg1:"--repository-name=Repository_1" --arg2:"--script=SaveBootProject" --arg3:"--version=1.0" --arg4:"--tester=autobuild" –arg5:"--store"
Exit code | Description |
---|---|
| No error has occurred. |
| There is no path specified for saving the HTML test report. |
| The specified directory for the HTML report does not exist and cannot be created. |
| There is no path specified for saving the XML test report. |
| The specified directory for the XML report does not exist and cannot be created. |
| The report name is blank or an invalid report name has been entered. |
| The report name is invalid because the last character is a period. |
| The entered command line option is invalid. |
| The |
| The |
| The |
| The entered repository name entered is unknown. |
| The repository is located in a different place than explicitly specified. |
| The repository cannot be opened. |
| The XML test report cannot be exported. |
| The HTML test report cannot be exported. |
| An error occurred while monitoring the test. |
| There is no test result from the execution. |
| The execution of the For more information, see: Reindex |
| No valid license has been found for the CODESYS Test Manager. No test report has been generated. |