Tricentis Tosca accelerates testing with a scriptless, no-code approach for test automation. Integrating Tricentis Tosca with BrowserStack helps you run test scripts recorded on Tricentis Tosca on BrowserStack devices and desktop browsers.
Prerequisites
BrowserStack Username and Access Key to set up the BrowserStack integration. After logging into 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 registered account at Tricentis. You can sign up for a demo account here. You need to download Tosca + ARA (Automation Recording Assistant).
Select your test and update the test configuration details. Select PROJECT > Settings > TBox > Engines > XBrowser > WebDriver > BrowserStack and add your BrowserStack Username and Access key as specified in your Account Settings.
Add HubAddress and set its value to BrowserStack in the Test Configuration.
Run the test and view the test execution on BrowserStack’s Automate Dashboard.
Follow these rules while setting the browser and OS capabilities:
Set the Browser to Chrome (This is the TCP browser, which is a mandatory parameter for the test to be triggered from Tosca).
Set the other desired capabilities using the format Webdriver_<capabilityname>. To specify the browser capabilities, you can use our capability generator.
Sample capabilities for Chrome desktop:
The capabilities that contain a ‘.’ need to be replaced by a double underscore ‘__’. More details are available on the Tricentis documentation page. For example, use Webdriver_browserstack__local instead of browserstack.local.
To improve performance, set Fibermode as TRUE in Tosca. It reduces the non-essential Selenium requests that Tosca otherwise generates.
Set the browserstack local capability as true in the desired capabilities:
WebDriver_browserstack__local: `true`
Scan using BrowserStack sessions
To scan with Tosca XScan using a BrowserStack session:
Initiate Tosca XScan to record your actions and create the test steps. Right-click a Module folder or use the dynamic menu Modules and select Scan > More > Web Driver.
When the XScan window is visible, click on Browser > Scan.
Select BrowserStack in the hub address. Along with this, you can set the browser, browser_version, and the OS. You can also add the URL of the page that you intend to scan. Note that the Username, access key, and Hub URL were set in Project > Settings.
Select the window you want to scan and click the Scan button to start scanning the application.
You can see all the items scanned from the web application page. Select these items and save it.
You can see the scanned modules that you can use to create your tests.
Go to PROJECT > Settings > TBox > Engines > Mobile30 and set the Value field for Desired capabilities as the path of the folder containing the .conf file.
Click the Scan button in the toolbar and select the option Mobile.
Add the device and the app to scan. Please note that you need a valid Tosca license to execute this step.
Enter the name of the device in the device ID field as specified in the capabilities builder. Note that the device ID should be the same as the name passed in capabilities for other automation tests.
Click the Add New button. Enter Remote in the field Type and https://hub.browserstack.com/wd/hub in the field Appium server address. Click the Add button to add the new connection.
Enter the name and the URL of the web application you need to scan.
Click Advanced configuration. Select your .conf file and add it. Click the Connect button.
To run mobile tests in parallel, you can use Execution Lists.
Run web tests on BrowserStack mobile devices
To run mobile tests in parallel, you can use Execution Lists.
Follow these steps to run web tests on BrowserStack mobile devices using Tosca:
Select the test case and set the test configuration as shown in the following screenshot.
Here is an expanded view of the test configuration.
Open the Set Desired Capabilities folder from the following location.
Set the parameters in Set Desired Capabilities as follows:
Right-click a test case and click Run in ScratchBook.
Scan web applications on BrowserStack mobile devices
Use Tosca 16 patch 1 or higher to avoid errors in scanning Android mobile browsers. The .conf file is not supported in Tosca 16. Instead, you can add the capabilities using the Tosca Commander mobile scanner. Follow these steps to scan web applications on BrowserStack mobile devices using Tosca:
Click the Scan button on the toolbar and select Mobile.
Add the device and the app. Note that you can proceed further only if you have a valid Tosca license.
Set the device ID to the name of the device. This device ID is the same as the name passed in capabilities for other automation tests based on the BrowserStack Capabilities builder.
Add a new connection. Give it a suitable name. Enter Remote in the Type field and enter the address https://hub.browserstack.com/wd/hub in the Appium server address field.
Select the connection you created from the drop-down. Select the device platform versions according to your requirement and click Save.
Specify the details of the web application you need to scan.
Click Advanced configuration, add the desired capabilities as selected in the BrowserStack Capability generator, and then click the Add button.
Enter the PackageName or ActivityName while setting up advanced configurations. Do not enter the full path of the scanned application. You might face BROWSERSTACK_INVALID_APP_CAP error if the full path is added.
When you see the following screen, you can scan your application on BrowserStack cloud devices.
If the mobile scan window is not scaling correctly, set the display resolution to 100% in the Windows settings.
Click the Execution Tab. On the ExecutionLists folder, add the test configuration parameter ExecuteInParallel and set its value to True.
Right-click the ExecutionLists folder and click the highlighted icon to create an Execution List. You can drag and drop the Test cases in the Execution List.