BrowserStack Automate lets you run automated tests on remote browsers and platforms. In Ranorex Studio, you can connect to BrowserStack by configuring a WebDriver endpoint and then assigning an endpoint configuration to your test suite.
This article explains how to set up a BrowserStack WebDriver endpoint and run Ranorex tests on BrowserStack Automate.
Before you start
After successfully creating a solution, Ranorex configures the default test suite with the following modules:
- OpenBrowser
- Recording1
- CloseBrowser
Make sure your solution is ready before you configure the BrowserStack endpoint.
Add a BrowserStack WebDriver endpoint
To connect Ranorex Studio to BrowserStack Automate, first add a WebDriver endpoint for the BrowserStack Selenium Grid hub.
- In the menu bar, click View > Endpoints.
- In the Endpoints window, click Add Endpoint.
- In the Endpoints tab on the right, configure the following:
- Select endpoint type: Choose WebDriver
- Specify Webdriver endpoint: Enter a Name for your endpoint and the Address (Hub URL)
- Click Test Connection, to verify the setup. Once connected, click Add endpoint
You have successfully set up a WebDriver endpoint for BrowserStack Selenium Grid Hub URL.
Executing Ranorex tests on BrowserStack Automate
To execute Ranorex tests, follow these steps:
- In the Endpoints dialog, click and select View details
- In the details section, click Add new configuration
-
Enter the required details of your Endpoint configuration:
- Name
- Description
-
Capabilities JSON, for more information on how to create Capabilities JSON, go to Create your own JSON with our capabilities configurator.
Example
{ "platform": "Windows 10", "browserName": "chrome", "version": "58.0", "browserStack.user": "PLEASE PUT YOUR USERNAME HERE", "browserStack.key": "PLEASE PUT YOUR ACCESSKEY HERE" }
To access the internal test infrastructure, add
“local”: “true”. This enables local testing using the BrowserStack Local binary.
Select the active configuration
After you create the endpoint configuration, expand the Active Configuration drop-down and select the configuration you want to use.
This ensures that Ranorex uses the correct BrowserStack settings during test execution.
- Expand the Active Configuration drop-down to select the configuration you added previously.
-
In the test suite, select Recording1, click Record, and add new actions.
Assign the WebDriver endpoint to the test suite
After the endpoint configuration is complete, make sure the test suite is configured to use the BrowserStack WebDriver endpoint.
This step ensures that the test runs on BrowserStack Automate instead of the local browser.
- Once the configuration is completed, go to the test suite and make sure that the WebDriver is set as an Endpoint to run the test on BrowserStack.
- Run the test with the previously recorded steps and the BrowserStack configurations.
- The test is executed successfully, and the results are displayed in the BrowserStack Automate dashboard. A Ranorex report is generated.
Your Ranorex tests are now running successfully on BrowserStack Automate.