Defining a variable in a test to run the latest version of an application

When you import or upload two versions of the same application to your workspace, by default the preferred version of the application to replay a test will be the earlier version, if this earlier version is used to record the test. This preference is specified in the launch application action of the test, and you can change the preference so that the latest version of the application available in your workspace is used to replay your test. To modify the behavior, define a variable with a mobile reserved name in your test and set the variable to a specific value. This ensures that, for a test launched in an automated test environment such as IBM® Rational® Quality Manager or from a command-line, the latest imported version of the application is selected without modifying the linked application in the test.

Before you begin

Open a test from the Test Navigator view. You must define a variable whose name is RTW_Mobile_App_Selection in your test and assign the AlwaysUseLatestVersion value to the test variable. If you do not have any container for your variables in your test, learn how to create one based on the procedure described in Defining a variable in a test to select a mobile device.

About this task

This action is applicable to tests created from Android, iOS, hybrid or Web UI applications.


  1. To define the RTW_Mobile_App_Selection variable:
    1. In the test script, select the test variable node.
    2. Click Insert > Variable Declaration.
    3. Enter the name of the variable RTW_Mobile_App_Selection and click OK. The variable is added to the test variable container.
    4. In the Visible in section, select This test only to restrict data to the current test. Optionally select All tests for this user to share the value of this variable when the test runs in a compound test. For the variable to be shared, both tests must have a variable with the same name and must have this option enabled.
  2. Assign the AlwaysUseLatestVersion value to the variable:
    1. Click Initialize value to and enter the value AlwaysUseLatestVersion in the Text field. This will select the latest imported application version, not the one the test is linked to or defined as the preferred application.
      Mobile variable defined to run the test with the latest version of the application
    2. Save the test.