Configure tests in online clouds

You can run Mobile Engine 3.0 tests on cloud devices, emulators, and simulators. To do so, you must create specific test configuration parameters (TCPs) for each online cloud. Tosca is cloud-agnostic. You can use the following online clouds:

For information on how to scan mobile applications in the cloud, see chapter "Scan mobile applications in the cloud".

Cloud TCPs overview

The table below lists all available TCPs for online clouds.

Mobile TCP

BrowserStack

HeadSpin

Perfecto

Sauce Labs

AppiumServer

AppPath

Browser (hybrid and web app)

DeviceName

*

IsSimulator

OperatingSystem

OSVersion

PerfectoToken

SauceAccessKey

SauceUsername

* You don't need to specify the DeviceName TCP for Perfecto if you use OSVersion, DeviceManufacturer, DeviceModel and IsSimulator instead (see chapter "Dynamic device allocation in Perfecto").

For a list of all mobile TCPs, see chapter "Mobile TCPs overview".

Enable controls visibility check in the clouds

Enable or disable the control visibility check

By default, Mobile Engine 3.0 checks controls visibility for local test automation and it skips the visibility check for test automation in the supported clouds.

You can enable or disable the visibility check depending on your mobile application and performance requirements.

Tricentis recommends disabling the visibility check if you run your tests in the clouds that are not supported.

To enable or disable the visibility check only for test execution, create the TCP SkipVisibilityCheck and set its value to True or False depending on whether you want to skip the visibility check or not.

To enable or disable the visibility check for both the Mobile Scan and test execution, follow the steps below:

  1. Go to C:\ProgramData\TRICENTIS\TOSCA Testsuite\7.0.0\Settings\XML and open the file Settings.xml.

  2. Under <Category name="Mobile30">, add the following line of code before the closing tag:

    <Setting name="Automation.Mobile30.SkipVisibilityCheck" legacyPath="Automation.Mobile30.SkipVisibilityCheck">False</Setting>

  3. Set the value of this setting to True or False depending on whether you want to skip the visibility check or not.

  4. Restart Tricentis Tosca.

Specify TCPs for BrowserStack

To run your tests in BrowserStack, follow the steps below:

  1. If you test a native or hybrid app, upload it to your BrowserStack account. To do so, click on UPLOAD APP in the menu. Once your application is uploaded, BrowserStack displays a unique identifier that you need for test configuration.

Unique identifier for an app in BrowserStack

  1. Specify the following TCPs:

Mobile TCPs

Description

AppiumServer

Enter the Appium Server for your BrowserStack account.

It consists of the following elements:

  • Your User Name, followed by a colon (:)

  • Your Access Key

  • @hub-cloud.browserstack.com/wd/hub

For example: https://<Your User Name>:<Your Access Key>@hub-cloud.browserstack.com/wd/hub

Your User Name and Access Key are available in your BrowserStack, under ACCESS KEY in the menu.

AppPath

For an Android application, enter the PackageName and Activity of your application.

For an iOS application, enter the BundleID of your application.

DeviceName

Enter the name of the device available in BrowserStack, for example: Samsung Galaxy S9.

OperatingSystem Enter your platform name: iOS or Android.
OSVersion Enter the OS version of the device that you want to test, for example: 10.0.
  1. As the first TestStep in your TestCase, add the Module Set Desired Capabilities and specify the Desired Capabilities for your type of application:

Type of application

Desired Capabilities

Native application

For a native application, specify the following Desired Capabilities:

  • browserstack.user with the value of your BrowserStack account.

  • browserstack.key with the unique key of your BrowserStack account.

  • app_url with the path to an application that you store on your BrowserStack account. For example, bs://jioqw82hedidw.

  • device with the device name of your BrowserStack device.

  • os_version with the version of the mobile operating system.

  • iOSResign with the value True. This Desired Capability applies only to tests of iOS apps.

Hybrid application

For a hybrid application, specify the following Desired Capabilities:

  • browserstack.user with the value of your BrowserStack account.

  • browserstack.key with the unique key of your BrowserStack account.

  • app_url with the path to an application that you store on your BrowserStack account. For example, bs://jioqw82hedidw.

  • device with the device name of your BrowserStack device.

  • os_version with the version of the mobile operating system.

  • autoInstrument with the value True.

  • useAppiumForHybrid with the value True.

Mobile web application

For a mobile web application, specify the following Desired Capabilities:

  • browserstack.user with the value of your BrowserStack account.

  • browserstack.key with the unique key of your BrowserStack account.

  • device with the device name of your BrowserStack device.

  • os_version with the version of the mobile operating system.

In this example, you configure a test for a native Android application. To do so, you set the required TCPs:.

TCPs for an Android native application in BrowserStack

Then you set the following Desired Capabilties:

Desired Capabilities for an Android native application in BrowserStack

Specify TCPs for HeadSpin

To run your tests in HeadSpin, specify the following TCPs:

Mobile TCPs

Description

AppiumServer

Enter the address of the Appium Server that is assigned to your device.

To do so, follow the steps below:

  1. In HeadSpin, ensure that you have an API Token. To do so, go to Settings in your account. You can see your token in the API Tokens section. If there is no token, click on +New Token.

  2. Go to the Remote Control tab.

  3. Click on More Actions for your device and select Automation Configuration.

  4. Under WEB DRIVER URL, click on the address to copy it to your clipboard.

DeviceName

Enter the ID of your HeadSpin device.

You can find it in the Remote Control tab, in the Device ID column.

Alternatively, you can copy the value of the udid capability from the Automation Configuration window.

WEB DRIVER URL in HeadSpin

In this example, you configure a test for a web application on an iOS device in HeadSpin.

  • You specify the Browser TCP, because it's mandatory if you test mobile web applications.

  • You specify the following TCPs for HeadSpin: AppiumServer and DeviceName.

TCPs for a mobile web application on an iOS device in HeadSpin

Specify TCPs for Sauce Labs

To run the tests in Sauce Labs, specify the following TCPs:

Mobile TCPs

Description

AppiumServer

Enter the address of the Sauce Labs Appium server.

For the endpoint located in Europe, use https://ondemand.eu-central-1.saucelabs.com/wd/hub.

For the endpoint located in the US, use https://ondemand.us-west-1.saucelabs.com/wd/hub.

To avoid high latency, Tricentis recommends that you use the endpoint which is geographically closer to you.

DeviceName

Enter the full name of your device in Sauce Labs.

You can find a list of available devices and simulators, as well as their names and versions, in your Sauce Labs account or on the Sauce Labs Platform Configurator when you select the Appium framework.

Alternatively, skip this TCP and enable the Mobile Engine 3.0 to dynamically allocate a device.

OSVersion

Enter the version number of your device, emulator, or simulator.

If you don't specify this TCP for an iOS simulator, Tricentis Tosca uses the default version iOS which you can edit under Project->Settings->TBox->Engines->Mobile30->Default iOS Simulator Version.

SauceAccessKey

Enter the access key for your Sauce Labs account.

To find your Access Key, follow the steps below:

  1. Sign in to your Sauce Labs account.

  2. Go to Account->User settings in the upper right corner.

    Your SauceAccessKey is in the Access Key section.

SauceUsername

Enter the user name of your Sauce Labs account.

Sauce Labs supports tests automation for the following subscription plans:

  • Virtual Cloud

  • Real Device Cloud

  • Enterprise-grade reliability & premium support

In this example, you configure a test for an Android application in Sauce Labs:

  • You specify the TCPs for Sauce Labs: AppiumServer, DeviceName, SauceAccessKey, and SauceUsername.

  • For the AppiumServer TCP, you use the endpoint which is geographically located closer to you.

TCPs for an Android application in Sauce Labs

Use dynamic device allocation in Sauce Labs

To enable dynamic allocation of devices in Sauce Labs, use dynamic expressions instead of the full device name, for example: iPhone.*.

For detailed information, see the Sauce Labs documentation.

Prepare tests of native applications on iOS simulators in Sauce Labs

To test native applications on an iOS simulator in Sauce Labs, follow the steps below:

  1. Create a ZIP file out of your APP file.

  2. Upload the ZIP file to Sauce Storage.

  3. In Tosca, drag and drop the standard Module Open Mobile App onto your TestCase.

  4. In the Value column, enter the path to your stored ZIP file as follows: storage:filename=<YourZipFile.zip>

Open Mobile App TestStep for an iOS simulator in Sauce Labs

Prepare tests of native applications on iOS and Android devices in Sauce Labs

To test native applications on an iOS device or an Android device in Sauce Labs, follow the steps below:

  1. Upload the IPA or APK file of your application to Sauce Storage.

  2. In Tosca, drag and drop the standard Module Open Mobile App onto your TestCase.

  3. In the Value column, enter storage:filename=<YourApplication>.

    Replace <YourApplication> depending on which platform you run your tests:

    • Enter your IPA file name for an iOS device.

    • Enter your APK file name for an Android device.

Open Mobile App TestStep for an iOS device in Sauce Labs