Show TOC

<command-line>Locate this document in the navigation structure

The <command-line> element allows for the execution of a command on the client device during test script playback. This element can specify how long to wait for the command to return and its expected exit code. The contents of the element are the commands to execute. Alternately a command may be specified using the cmd attribute of the element. These commands can be written to a temporary file that itself will then be executed by the <command-line> element. The default file extension for this file is .bat, though this can be overridden. If the specified command cannot be executed a script error is thrown.

Structure
Contains:
  • Text - The command(s) to be executed by the element.
Contained By:
  • <script>
Table 1: Attributes
Name Description Data Type Default Value Required
cmd This attribute specifies the command to be executed by the element, or to pass parameters to a temporary file created by the element that will be executed. The first value in this parameter should be the token %1 when used to pass parameters to a temporary script file. This should then be followed by the parameters, each separated by whitespace. The contents of the element should then be the command with the tokens %1 through %n for each parameter specified in the cmd attribute. string None No
ext This attribute specifies the file extension for the temporary file to contain the commands executed by the element. The default file extension is .bat. The value of this attribute can optionally include a leading period (.). string .bat No
waitFor This attribute specifies the duration of time in milliseconds to wait for the command to complete execution. The value -1 indicates to wait indefinitely. The value 0 indicates to execute the command and not wait for it to complete. The script will continue playback regardless of the result of executing the command. If the command does not exit before the specified duration elapses a script error is thrown. integer 0 No
expectedExit This attribute specifies the expected exit code to be returned by the processes executed by the command. This can be any non-negative integral number. This attribute is ignored if waitFor is set to 0. If this attribute is not specified, the exit code of the command will not be checked. If the exit code differs from the value specified a script error is thrown. non-negative integer. None No
common script attributes This element includes the following common script attributes:
  • timeout
  • sleep
  • frame
N/A N/A N/A