Welcome to the Ranorex Support Portal

Cross-device mobile tests

In this chapter, we’ll show you how you can configure one test to run on several different devices of the same mobile OS (Android OR iOS) consecutively and even in parallel.

The configuration is based on data-driven testing and is the same for both Android and iOS. For the sake of simplicity, the screenshots refer to Android only.

Configure a consecutive cross-device test


  1. Open the first recording module in your test. It should contain the Run mobile app action.

  2. Click the Endpoint property and click As new variable…

  3. Name the variable varMobileDevice. This variable will control which device the test app will be started on, and therefore where the test will be run.

  1. Switch to the test suite view.

  2. Right-click the test suite that contains the recording with the Run mobile app action and click Data source…

  1. In the dialog that opens, click New > Simple data table.

  1. Fill the data table with the names of the desired devices as they appear in the endpoints pad.

  1. Click Data binding and under Module variable, bind the data column with the device names to the device variable varMobileDevice.

  1. The test will now be iterated for each device in your data source. This will also be reflected in your report.

Configure a parallel cross-device test


It’s also possible to run one test on multiple devices at the same time.

1

First:

a

Configure a variable as in steps 1-3 in the instructions for a consecutive cross-device test above.

b

Or simply disable the existing data source if you’re working with the test from the instructions for a consecutive cross-device test above.

  1. In the test suite view, right-click the test suite node and click Global parameters…

  2. Add a global parameter called globalMobileDevice.

  1. Right-click the test case that contains the recording where you specified the variable and click Data binding…

  2. Under Parameters > Module variable, bind the variable to the global parameter.

  1. In the repository, find the app folder for your mobile app and click EDIT IN SPY.

  1. Modify the path as in the screenshot below and ensure the attribute devicename has the value $varMobileDevice, i.e. the device variable specified earlier.

  1. To run your test in parallel, start it from a command line environment with the following arguments:

start MobileTest.exe /pa:globalMobileDevice="Galaxy Nexus"
start MobileTest.exe /pa:globalMobileDevice="GT-P7500"

Download

Reference


Running tests from the command line is explained in:

Ranorex Studio fundamentals > Ranorex Studio Overview > ⇢ Run tests without Ranorex Studio

USERS LOVE US

SUBSCRIBE TO OUR NEWSLETTER

Get the latest test automation information right in your mailbox.

FOLLOW US

© 2024 Ranorex GmbH. All Rights Reserved