BrowserStack Desktop

Introduction

Provar supports BrowserStack Desktop from Provar version 1.9.9 onwards.

BrowserStack is a cloud web and mobile testing platform that enables developers to test their websites and mobile applications across on-demand browsers, operating systems and real mobile devices, without requiring users to install or maintain an internal lab of virtual machines, devices or emulators.

Configuring BrowserStack in Provar

Pre-Requisites

Before configuring a BrowserStack Desktop App in Provar, you should have already sorted your BrowserStack setup and have your username and access key. Refer to Browserstack’s documentation for more information on completing this setup in BrowserStack.

Adding a Browser Provider

To begin configuring the BrowserStack in Provar, start by adding a new Browser Provider.

Navigate to the Test Settings view and click the Browser Providers tab. Then click the Add New (‘+’) button:

On the ‘Add new Browser Provider screen’, add a ‘Provider Name’ and select the ‘BrowserStack Desktop’ radio button.

Add your BrowserStack details to connect to BrowserStack:

Use the ‘Test Connection’ button to verify the server details.

Next, add the Browsers that will be used by clicking the Add New (‘+’) button on the Browsers section:

Adding Browsers

On the ‘Add BrowserStack Desktop Browsers’ page, select the Platform where testing is going to be carried out. (You can ignore the Browser Name as this will be prepopulated based on your other selections.) The Platform dropdown will show all the platforms assigned to the relevant BrowserStack account.

Then select a Web Browser and a Browser Version. For Browser Version, you can select ‘latest’ instead of a specific version if you want to run on the latest version of your chosen browser.

Then select the ‘Screen Resolution’:

Once you are happy with the device details provided, click the ‘OK’ button to continue.

Back on the Browser Provider details screen, you can now click the ‘OK’ button to complete adding the new Browser Provider.

Now that you have added a new Browser Provider for BrowserStack, you should see this reflected on the Browser Providers tab:

Running Tests on BrowserStack for Desktop

To start executing test cases, first select the new Web Browser which you created above:

Once setup has been completed tests can be run in Run mode, Debug mode or Run under ANT.

Run and Debug Mode Execution

To start executing test cases, first select the new Web Browser which you created above:

This can also be set for a particular test case by using the ‘Web Browser Override’ on the test’s Connection step.

Then click Run or Debug to run the test. Progress can be monitored as usual in the Test Runner:

In the BrowserStack Dashboard under the Automate section, you can see all the running sessions and those previously executed.

Click on a given session to see all the running details:

Click the session link to see details such as the running browser, machine information, test logs and video:

Note that the Job Name shows as ‘Build: Provar Test Run ‘System Time Stamp’, as above.

Run under ANT execution

Provar also provides Run under ANT execution for BrowserStack Desktop.

To select this, right-click on the test(s) or folder and select ‘Run Under ANT’.

In the ANT Dialog, select the new Web Browser you created above:

This will add the following parameters to the Build.xml file:

Running this file will initiate the session/run in a similar way to the Run and Debug mode sessions above.

Proxy Environments

BrowserStack execution will work as normal when there are proxies defined under Provar Network Settings, or defined under the Desired Capability of the Browser Provider as a ‘proxyURL’ (see below).

Note that, if proxy information is set up at both levels, Provar will give preference to the proxy information in the Desired Capability setting in the Browser Provider.

To add a proxy at the Browser Provider level, open the Browser Provider in edit and go to the Desired Capabilities section.

Click the ‘Add New’ (‘+’) icon:

On ‘Add new desired Capabilities’ screen, enter a Name of ‘proxyURL’ and the Value.

Then click ‘OK’.

Once added, use the ‘Test Connection’ button to make sure the connection is working as expected.

Modifying the Job Name

You can define a custom Job Name if you would like to present a specific name in BrowserStack. This is helpful when you have multiple sets of test cases. If a custom Job Name is defined, a single entry will be created with a grouping of test cases inside.

You can define a custom Job Name by setting up a new system environment variable or in console where an ANT job is running. If the environment variable PROVAR_BROWSERSTACK_BUILDNAME is set, this name will be used as the build name.

This can be done by setting up a new system environment variable of PROVAR_BROWSERSTACK_BUILDNAME:

The system environment variable can also be set in the console:

Limitations

The following limitations currently exist in Provar’s implementation of BrowserStack.

Accessing Chrome profiles

Normally, when Provar’s test execution happens locally, Provar users can specify the Google Chrome profile that should be used in the execution. This is not supported when executing tests over BrowserStack as the execution will be happening at the remote node. Due to this limitation, you’ll need to re-provide a password and verification token when executing over BrowserStack, or your IP will need to be whitelisted. Salesforce should know from where the request is coming so it can provide login access to execute the tests.

Accessing locally stored files

Normally Provar allows you to download a file locally to perform actions such as assertions. This is not supported when executing tests on BrowserStack because the remote node will not be able to access the locally downloaded file, so any tests which use locally downloaded files will not run successfully.

If you are affected by either of these limitations please contact Provar support directly for advice.