Skip to main content

Integrate BrowserStack App Automate with Tricentis Tosca for Appium

Introduction

Tricentis Tosca accelerates testing with a scriptless, no-code approach for test automation. Integrating Tricentis Tosca with BrowserStack will enable you to run the Tricentis Tosca recorded test scripts on 3000+ real devices and desktop browsers.

In this guide, you’ll learn to:

Pre-requisites

  • BrowserStack username and access key to set up the BrowserStack integration. Log in to your BrowserStack account, visit the Settings page and copy your username and access key. You can also sign up for a free trial here.
  • A Tricentis registered account. You can sign up for a demo account here.
  • Download and install Tricentis ARA (Automation Recording Assistant) tool.
  • Mobile app that you want to use for testing. You must also know the PackageName and ActivityName for Android app, or BundleID for iOS app that you want to scan.

Upload your app

Upload your Android app (.apk file) or iOS app (.ipa file) to the BrowserStack servers using the REST API:

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
-F "file=@/path/to/app/file/app-debug.apk" \

REST API response:

{
    "app_url":"bs://f7c874f21852ba57957a3fdc33f47514288c4ba4",
}

Use the app_url value in the REST API response (bs://f7c874f21852b....) to set the app capability.

Note: If you are running Tosca tests successfully in your local setup, you can directly start testing your app on BrowserStack and skip the configuring mobile scan section.

Scan your app on Tricentis Tosca

After you upload your app to BrowserStack, you need to scan all the modules in your app that you can later use to create test cases.

To scan the mobile app:

  1. Launch the Tosca Commander.
  2. Click Create New to create a new project and provide a name for the new workspace.

    Tosca create new project
  3. Create a Browserstack.conf configuration file as follows in the %TRICENTIS_ALLUSERS_APPDATA%\Automation\Mobile30\Configuration directory. This file is used to locate and scan the app for Modules that you will use to create test cases.

     browserstack.user,<BROWSERSTACK_USERNAME>
     browserstack.key,<BROWSERSTACK_ACCESS_KEY>
     app_url,<app_url>
     device,Google Pixel 6
     os_version,12.0
     PlatformName,Android
    

    Tosca desired capabilities path

  4. Click the Modules tab, and then click Scan -> Mobile.
  5. Under Select device, click Add device.
  6. With Remote option selected, click Add New to create a new connection. Add a name for the connection, and then set the Appium Server Address as https://hub-cloud.browserstack.com/wd/hub. Click Add to save the configuration.

    Tosca create connection
  7. In the Add device screen, set the device name and a device ID. Click Add to save the configuration. Set the device name and ID same as defined in the browserstack.conf file.
  8. Under Select device, click Add Application.
  9. Select Native/Hybrid and click Continue.
  10. Select either iOS or Android. Based on the OS you selected, provide the name of the application and application full path or bundle ID. Click Add to save the configuration.
  11. Click Add Configuration to add the browserstack.conf created in step 3. Select the configuration file and click Add.
  12. Click Connect. This starts a connection on a BrowserStack device, which is used to scan your application for Tosca.
  13. Click Scan to start scanning modules. After the scan results are displayed, ensure to add modules for the screen.
  14. Click Finish screen and Close to save the module. Repeat steps to scan modules of each screen that you want to use for writing your test cases.

Create and run test in Tosca for BrowserStack

After you have scanned required modules and also the standard modules, you can start creating tests in Tosca.

Prerequisites

To create and run tests in Tosca:

  1. In Tosca Commander, drag and drop the required modules from the Modules tab to the TestCases tab. Ensure that you drag the Standard.tsu module.
  2. Create your test case as per your requirement and add the Set Desired Capabilities step to it.
  3. Click a test case that you want to run on BrowserStack. Click the Test Configuration tab.
  4. Set the Appium Server to https://hub-cloud.browserstack.com/wd/hub. Ensure that you change the Appium server to the BrowserStack hub URL for each test that you want to run on BrowserStack.
  5. Specify the relevant capabilities in Set Desired Capabilities, such as browserstack.user, browserstack.key, device, os_version, and app.

    Tosca set desired capabilities

    Note:The device name, OS version, and other respective details can be found in the BrowserStack capability generator.
  6. Right-click your test case and click Run in ScratchBook.

    Tosca run scratchbook

The session launches on App Automate with the selected device configuration.You can view the session on the BrowserStack App Automate Dashboard.

Run local tests with Tosca on BrowserStack

If you want to test your mobile app hosted locally, ensure that you pass the browserstack.local capability and set it to true in the the Set Desired capabilities step in your test case.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Talk to an Expert