Running Windows tests from the command-line interface

You can run a Windows test without using the desktop client by using the command-line interface. You can either run the Windows test on the local computer or on a remote computer.

Running the command

If you want to run the Windows test on your local computer, then you can run the following command from the command-line:
Note: You must have recorded the Windows test.

cmdline -workspace workspace_full_path -project proj_rel_path -suite suite_rel_path

Creating a variable file

You need to create a variable file only when you want to run the Windows test in the following scenarios:

The -varfile parameter specifies the complete path to the XML file in the command. The XML file contains the name-value pairs of the variables.

You must include the -varfile parameter in the following command when you run from the command-line:

cmdline -workspace workspace_full_path -project proj_rel_path -suite suite_rel_path -varfile variable_file_full_path

Note: The variable file is not required when you run Windows test on a local computer that contains the same port number.

Variable file for the local computer on which you want to run Windows test

Create an XML file as a variable file that specifies the details of the local computer on which you have installed the Windows application and the UI Test Agent. The format of the variable file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<variable_init name="appium.server.port" value=<"port number"/>
</inits> </inits>
The following table lists the variable and the action required for the value field:
Name of the Variable Value
appium.server.port Specify the port number of the UI Test Agent that is installed on your local machine.
For example,
<?xml version="1.0" encoding="UTF-8"?>
<variable_init name="appium.server.port" value="7082"/>
</inits>

Variable file for the remote computer on which you want to run Windows test

Create an XML file as a variable file that specifies the details of the remote computer on which you installed the Windows application and the UI Test Agent. The format of the variable file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<inits xmlns=<"Windows application path">
<variable_init name="appium.server.host” value=<"host number"/>
<variable_init name="appium.server.port" value=<"port number"/>
</inits>
The following table lists the variable and the action required for the value field:
Name of the Variable Value
appium.server.host Specify the IP address of the remote computer on which the UI Test Agent and the Windows applications are installed.
appium.server.port Specify the port number of the UI Test Agent that is installed on the remote machine.
For example,
<?xml version="1.0" encoding="UTF-8"?>
<inits xmlns="http://www.ibm.com/rational/test/lt/varinit">
<variable_init name="appium.server.host" value="10.115.160.148"/>
<variable_init name="appium.server.port" value="7082"/>
</inits>