Mobile Test Automation with Tosca This guide explains how to create and execute a mobile test with Kobiton devices in Tosca, from project setup to test execution on a device. Prerequisites An active Kobiton account. Get the following information from your Kobiton account in the Portal: Username. API key. Tosca Commander installed and activated. Create or open a Tosca workspace Follow Tosca’s guidelines to create or open a workspace in Tosca Commander. Connect to a Kobiton mobile device and scan mobile objects In your workspace, go to the Modules tab. Select Scan → Mobile from the Modules menu. In the Mobile Scan window, under Select connection, click Add connection. In the Add connection window: Enter a name for your connection, such as Kobiton Cloud or Kobiton Standalone. Set Type to Appium (Generic). For Server address: For Cloud/Hybrid environments, enter https://api.kobiton.com/wd/hub. For Cloud/Hybrid environments with custom domain, enter https://api-<custom-domain>.kobiton.com/wd/hub. For Standalone/On-Prem environments, enter [http|https]://[dell_ip_or_hostname]/wd/hub. Select Add. Under Select device, select Add device. Enter a device name, such as Galaxy Tab A7 Lite or iPhone 14. Enter the device’s UDID. Select Android or iOS, and choose Real. Select Add. Under Select application, choose Add app. Enter a name for the app. For app path, 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) for Android app, or bundleId for iOS app. If you are using appPackage/appActivity or bundleId, you must also provide the Kobiton store app ID (appium:app) under Set capabilities. Choose Add. Select Set capabilities to add required Appium capabilities. Select Add capability set. Add the following capabilities at minimum: Capability Value Required? appium:username <your_kobiton_username> Yes appium:accessKey <your_kobiton_access_key> Yes appium:app kobiton-store:<app_id> No (used for apps from the Kobiton App Repo) kobiton:runtime appium No (used for Appium Basic 2) Choose Select Capability Set. Ensure that the created connection, device, app, and capability set have been selected before continuing. (Optional) To scan using Live View, ensure Run Live View is checked. If using Live View on Android, you must set kobiton:runtime to appium in Set capabilities to navigate the app from the Live view. Otherwise, launch a Kobiton manual session on the device to navigate the app. Select Connect to start the connection. Select Scan to start scanning. Use your mouse to interact with the app’s interface and navigate as needed. Follow Tosca’s official guidelines for more details about mobile scan controls. When scanning is complete, select Close. After closing the Mobile Scan window, your session on Kobiton is still active until timed out. Go to the Kobiton Portal to manually terminate the session to make the device available for others or reduce public minutes use. Scanned elements are stored under the Modules folder and can be used across test cases. Create a new test case with scanned objects Follow Tosca’s guidelines to create a test case and add scanned modules to the test case. Configure Appium server parameter Select the created test case. In the Details plane, switch to the Test Configuration tab. Right-click anywhere in the Test Configuration tab and select Create Test configuration parameter icon. Add the configuration parameter AppiumServer and set its value to: For Cloud/Hybrid environments, enter https://api.kobiton.com/wd/hub. For Cloud/Hybrid environments with custom domain, enter https://api-<custom-domain>.kobiton.com/wd/hub. For Standalone/On-Prem environments, enter [http|https]://[dell_ip_or_hostname]/wd/hub. Import standard subset Select Import Subset from the Home menu. Navigate to C:\Tosca_Projects\ToscaCommander and select the standard.tsu subset. After importing, select the 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: Capability Value Required? appium:username <your_kobiton_username> Yes appium:accessKey <your_kobiton_access_key> Yes appium:udid <your_device_udid> Yes appium:app kobiton-store:<app_id> No (used for apps from the Kobiton App Repo) kobiton:runtime appium No (used for Appium Basic 2) Open Mobile App. Fill in the following: Mobile OS Parameter Description Example Android Application Direct URL to the app or AppPackage/AppActivity https://www.example.com/app.apk io.appium.android.apis/io.appium.android.apis.ApiDemos iOS Application Direct URL to the app or bundleId https://www.example.com/app.ipa com.example.app (Optional) add End Appium Session as the last test step to cleanly exit the Kobiton session. 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 until timed out. Execute the test case on a device Select the created test case. Right-click and choose Run in ScratchBook or use Run in ScratchBook on the toolbar to run the test case. During execution, you can launch a Kobiton mixed session on the device to monitor the test case in a manual session. You can also add the test case to test execution if needed.