Document toolboxDocument toolbox

Parallel Mobile Test Case Execution (Android and iOS)

Qualitia gives you a provision to execute test cases parallelly on different iOS and Android devices simultaneously. In order to do so, you must configure offline packages accordingly.

Prerequisites

  • You must create different offline packages for executing test cases on different mobile devices simultaneously.
  • Different mobile devices (real, emulators, or simulators) to execute test cases parallelly.
  • You must start separate Appium instance for each offline package separately.

Configurations

In order to execute multiple mobile application test cases simultaneously, you must configure each package accordingly.

  • Configuring the qualitia.properties file
  • Configuring androiddc.properties/iosdc.properties files as per the selected Platform
  • Configuring Appium

On this page:

Configuring qualitia.properties File

Qualitia allows you to configure test case environment related settings from the qualitia.properties file. Settings you configure here are used while executing test cases from that offline package.
With reference to execute multiple test cases parallelly on different mobile devices on a single Mac/Windows machine, you must set values to the following capabilities in the qualitia.properties file. You will find this file in the config folder of Qualitia offline package.

qualitia.properties

AppiumServerURL

Enter the Appium server URL. It contains hostname/IP of the machine where you have Appium server along with the port number you want Appium to use while running the server.
The port number should be unique in each offline package which you are going to execute simultaneously. By default, Appium uses port 4723. To run multiple sessions simultaneously, you must set different ports against AppiumServerURL. For example, 4723, 4722, 4726, and so forth.

MobileUDID

This capability enables users to select a mobile device from all the devices connected to the machine for test case execution. For more information on getting these UDIDs, refer to FA section.


Ensure you keep the AppiumServerURL (port) and MobileUDIDs unique for each offline package you want to run simultaneously.

Configuring androiddc.properties/iosdc.properties

Based on the operating system of the devices you are using for executing test cases, you must configure some settings in the iosdc.properties/androiddc.properties files.

  • To execute test cases on iOS devices or simulators, use iosdc.properties file.
  • To execute test cases on android devices or emulators, use androiddc.properties file.

iosdc.properties

You must set a few values in the iosdc.properties file to connect offline packages to the right session of Appium.

iosdc.properties

webkitDebugProxyPort

Define the proxy port. By default, Appium uses 27753.

wdaLocalPort

This is the web driver agent port. By default, Appium uses 8100.


Both property values should be unique for each offline package you create to execute parallelly.

Androiddc.properties

You must set a few values in the androiddc.properties file to connect offline package to the right session of Appium.

androiddc.properties

systemPort

It is used to connect to appium-uiautomator2-server. By default, Appium uses 8200. You can select from the 8200 to 8299 range.


This value should be unique for each offline package you create to execute parallelly.

Configuring Appium

In order to run multiple test cases simultaneously on a single machine, you must start a separate Appium session for each offline package. While starting each session, you must update the following settings so that the separate sessions will be used by different offline packages.

Appium Port

Use the port number that is defined in the qualitia.properties against the AppiumServerURL key.

WebDriver Agent Port

Use the port number defined in the iosdc.properties file against wdaLocalPort. This is required while executing test cases on iOS devices only.

Chromedriver Port

Set the port number to use for communicating to Chromedrivers. To avoid undefined behavior while executing multiple test cases in parallel, it is important to set the range of the ports to be used. By default, Appium used any free port.
The form of this capability is an array of numeric ports. For more information, refer to Appium documentation.

Qualitia uses this information mentioned above to connect offline packages to the Appium sessions.

Ensure you match the settings you have configured in the offline packages to run simultaneously. This way, you can execute n number of offline packages parallelly.

Test Case Execution

Once you have configured your offline packages, you can start executing test cases using these offline packages. Executing test cases parallelly is a three-step process.

  1. Connect Real Devices/start simulators or emulators,
  2. Start all required Appium sessions, and
  3. Execute offline packages.

Connect Real Devices/start Simulators/Emulators

Connect all the devices (real devices, emulators, or simulators) which you want to use while testing.

Start all required Appium Sessions

One offline package uses one session of Appium to execute test cases. You must first run all the Appium sessions based on the settings configured in offline packages. Suppose, you have 3 offline packages which you want to execute parallelly, start all the three Appium sessions based on the configurations set under offline packages.

Execute Offline Package

Once you have connected all the devices and started all the required Appium sessions, you can execute offline packages as usual.

To execute an offline package:

  1. Open the command prompt and navigate to the folder where you have stored an offline package.
  2. Execute the following command to execute an offline package:

    java -jar qualitiaoffline-x.x.x.jar
  3. Repeat the same procedure to execute other offline packages.

Not finding what you need?