User Guide: Mobile Test Automation with Tosca

This guide explains how to create and execute a mobile test in Tosca, from project setup to test execution on a device.

Prerequisites

  • A Kobiton account with access to Public or Local/Private Devices.

  • A Tosca account.

  • Tosca Commander installed.

Create a new Tosca workspace

This section is optional, you can open an existing workspace instead.

Open Tosca Commander.

Select Create New in the Recent Projects section.

(Optional) Select type of Repository.

Enter a name for your workspace.

Select OK to create the workspace.

Connect to a Kobiton mobile device and scan mobile objects

In Tosca Commander, go to the Modules tab.

Select Scan → Mobile from the Modules menu.

In the Mobile Scan window, under Select connection, click Add connection.

  • Enter a name for your connection, such as Kobiton Cloud or Kobiton Standalone.

  • Set Type to Appium (Generic).

  • For Server address, enter: https://api.kobiton.com/wd/hub.

  • Click Add.

Under Select device, click Add device.

  • Enter a name, such as Galaxy Tab A7 Lite.

  • Enter the device ID from Kobiton.

  • Select Android or iOS, and choose Real or Simulated as needed.

  • Click Add.

Under Select application, click Add app.

  • Enter a name for the app (for example, APIDemos). Use either:

    • A direct download URL to the app, or

    • The app’s appPackage/appActivity (e.g., io.appium.android.apis/io.appium.android.apis.ApiDemos).

    • If you are using appPackage/appActivity, you must also provide the Kobiton store app ID under capabilities.

  • Click Add.

(Optional) To scan using Live View, ensure Run Live View is checked. If using Live View, set the capability set type to Basic Appium 2 (Android).

  • Click Set capabilities to add required Appium capabilities. Include at least:

    username           <your_kobiton_username>
    accessKey          <your_kobiton_access_key>
    app                kobiton-store:<app_id>
    kobiton:runtime    appium
  • Click Select Capability Set

Select the created connection, device, and app, then select Connect.

Once the app loads, use your mouse to interact with the app’s interface and navigate as needed.

Click Scan to capture the mobile screen’s UI elements.

When scanning is complete, select Finish.

After exiting the Mobile Scan window, your session is still active. Go to the Kobiton Portal to manually terminate the session if needed.

Scanned elements are stored under the Modules folder and can be reused across test cases.

Create a new test case with scanned objects

In Tosca Commander, go to the TestCases tab.

Right-click the folder where you want to store the test case.

Select Create TestCase and give it a meaningful name (e.g., Test APIDemos).

Import standard modules

Select Import Subset from the Home menu.

Navigate to C:\Tosca_Projects\ToscaCommander and select the standard.tsu subset.

After importing, select Modules tab and expand the newly added Modules_import…​ folder: Standard modules > TBox Automation Tools > Engines > Mobile. All standard modules to be added in the next section are located here.

Add mobile automation modules

Drag and drop the following modules to your test case in this order:

  • Set Desired Capabilities (located under Mobile > Capabilities).

    This should be the first step in your test case. Enter the following capabilities at the minimum:

    username           <kobiton_username>
    accessKey          <kobiton_access_key>
    udid               <device_udid>
    app                kobiton-store:<app_id>
    kobiton:runtime    appium
  • Open Mobile App.

    For Android apps, fill in the following:

    AppPackage   io.appium.android.apis
    AppActivity  io.appium.android.apis.ApiDemos
  • Add your scanned test modules for the next steps.

  • End Appium Session (place this module as the last step)

Configure Appium server

Select the test case node.

In the Properties pane, switch to the Test Configuration tab.

Add the configuration key: AppiumServer and set its value to: https://api.kobiton.com/wd/hub.

Final Test Case Structure (Example)

Test APIDemos
├── Set Desired Capabilities
├── Open Mobile App
├── Mobile App - Test step 1
├── Mobile App - Test step 2
└── End Appium Session

This structure ensures the session is properly initialized with Kobiton and cleanly terminated afterward. Without the End Appium Session step, your session might stay active on the Kobiton Portal.

Name test steps clearly (e.g., "Tap Login Button", "Enter Username") for easy identification.

Execute the test case on a device

Select the created test case.

Right-click and choose Run in ScratchBook or use Run > ScratchBook on the toolbar.

Start execution.