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 Automation
Before configuring a BrowserStack Desktop App in Automation, 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 Automation, add a new Browser Provider.
Navigate to the Test Settings view and click the Browser Providers tab. Then click the Add New (‘+’) button:
Add a Provider Name and select the BrowserStack Desktop radio button on the Add new Browser Provider screen.
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:
On the Add BrowserStack Desktop Browsers page, select the Platform where testing will 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 the Browser Version, you can select the 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.
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, select the new Web Browser 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:
The Job Name shows as Build: Provar Test Run System Time Stamp, as above.
Run under ANT execution
Automation 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 similarly to the Run and Debug mode sessions above.
BrowserStack execution will work as normal when proxies are 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, Automation will prefer 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 ensure the connection works 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 the 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:
Overriding BrowserStack credentials
You can override the credentials defined for your BrowserStack browser provider configuration. This is helpful when executing tests in your CI/CD build pipeline using ANT. You can override the BrowserStack configuration username and access key values by passing a command line argument or by setting up a new system environment variable.
To override the username, set one of the following values in order of priority:
Command line argument: provar.browserstack.username
Environment variable: PROVAR_BROWSERSTACK_USERNAME
To override the access key, set one of the following values in order of priority:
Command line argument: provar.browserstack.accesskey
Environment variable: PROVAR_BROWSERSTACK_ACCESSKEY
Local testing with BrowserStack
BrowserStack provides the ability to test local web applications that are under development or not accessible outside of your corporate network by enabling Local Testing with BrowserStack and Local Testing with Automate.
Automation supports Local Testing with BrowserStack by configuring the desired capability with the browser provider configuration in Automation by adding the following desired capabilities:
Use this capability to test locally-hosted websites on BrowserStack by setting the value to true. For example, “browserstack.local”:true
Use this capability to specify your test’s unique local testing connection name. For example, “browserstack.localIdentifier”:”Test12345”
Additional support is provided to override the browserStack.localidentifier value by passing a command line argument or setting up a new system environment variable. This is helpful when executing tests in your CI/CD build pipeline using ANT. To override the browserStack.localidentifier, set one of the following values in order of priority:
Command line argument: provar.browserstack.localidentifier
Environment variable: PROVAR_BROWSERSTACK_LOCALIDENTIFIER
The following limitations currently exist in Automation’s implementation of BrowserStack.
Accessing Chrome profiles
Normally, when Automation’s test execution happens locally, Automation 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 happen 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
Usually, Automation lets you download a file locally to perform actions such as assertions. This is not supported when executing tests on BrowserStack because the remote node cannot access the locally downloaded file, so any tests that use locally downloaded files will not run successfully.
If you are affected by these limitations, please contact Provar support directly for advice.
Access world-class customer support at the Provar Success Portal
Providing ongoing support is part of our promise to help you deliver robust, scalable, and repeatable testing to achieve release agility, drive down system errors, and get the maximum return on your Salesforce investment. Please contact us for more information. If you have any questions regarding BrowserStack, please get in touch with us, and we would be happy to help. To raise a case, simply log into the Provar Success Portal and click View/Raise Case.
- Provar Automation
- Installing Provar Automation
- Updating Provar Automation
- Using Provar Automation
- API Testing
- Behavior-Driven Development
- Creating and Importing Projects
- Creating Test Cases
- Custom Table Mapping
- Debugging Tests
- Defining a Namespace Prefix on a Connection
- Defining Proxy Settings
- Environment Management
- Exporting Test Cases into a PDF
- Exporting Test Projects
- Override Auto-Retry for Test Step
- Managing Test Steps
- Namespace Org Testing
- Provar Automation
- Provar Test Builder
- Refresh and Recompile
- Reintroduction of CLI License Check
- Reload Org Cache
- Running Tests
- Searching Provar with Find Usages
- Secrets Management and Encryption
- Setup and Teardown Test Cases
- Tags and Service Level Agreements (SLAs)
- Test Cycles
- Test Plans
- Testing Browser Options
- Tooltip Testing
- Using the Test Palette
- Test Palette Introduction
- Control Test Steps
- Generate Test Case
- List Compare
- Page Object Cleaner
- Read Test Step
- String Test Steps
- UI Test Steps
- Using Custom APIs
- Callable Tests
- Data-Driven Testing
- Page Objects
- Block Locator Strategies
- Introduction to XPaths
- Creating an XPath
- Label Locator Strategies
- Maintaining Page Objects
- Mapping Non-Salesforce fields
- Page Object Operations
- Refresh and Reselect Field Locators in Test Builder
- Using Java Method Annotations for Custom Objects
- Applications Testing
- Database Testing
- Document Testing
- Email Testing
- Mobile Testing
- OrchestraCMS Testing
- Salesforce CPQ Testing
- ServiceMax Testing
- Skuid Testing
- Vlocity API Testing
- Webservices Testing
- Provar Manager
- How to Use Provar Manager
- Provar Manager Setup
- Provar Manager Integrations
- Release Management
- Test Management
- Test Operations
- Provar Manager and Provar Automation
- Setting Up a Connection to Provar Manager
- Object Mapping Between Automation and Manager
- How to Upload Test Plans, Test Plan Folders, Test Plan Instances, and Test Cases
- Provar Manager Filters
- Uploading Callable Test Cases in Provar Manager
- Uploading Test Steps in Provar Manager
- How to Know if a File in Automation is Linked in Test Manager
- Test Execution Reporting
- Metadata Coverage with Manager
- Provar Grid
- Introduction to Provar DevOps
- Introduction to Test Scheduling
- Apache Ant
- Configuration for Sending Emails via the Automation Command Line Interface
- Continuous Integration
- AutoRABIT Salesforce DevOps in Provar Test
- Azure DevOps
- Running a Provar CI Task in Azure DevOps Pipelines
- Configuring the Automation secrets password in Microsoft Azure Pipelines
- Parallel Execution in Microsoft Azure Pipelines using Multiple build.xml Files
- Parallel Execution in Microsoft Azure Pipelines using Targets
- Parallel execution in Microsoft Azure Pipelines using Test Plans
- Bitbucket Pipelines
- GitHub Actions
- Integrating GitHub Actions CI to Run Automation CI Task
- Remote Trigger in GitHub Actions
- Parameterization using Environment Variables in GitHub Actions
- Parallel Execution in GitHub Actions using Multiple build.xml Files
- Parallel Execution in GitHub Actions using Targets
- Parallel Execution in GitHub Actions using Test Plan
- Parallel Execution in GitHub Actions using Job Matrix
- GitLab Continuous Integration
- Travis CI
- Execution Environment Security Configuration
- Provar Jenkins Plugin
- Parallel Execution
- Running Provar on Linux
- Salesforce DX
- Team Foundation Server
- Version Control
- Masking Provar Credentials on CI
- Salesforce Testing
- Adding a Salesforce Connection
- Assert Page Error Messages on Add/Edit Product
- Internationalization Support
- List and Table Testing
- Salesforce Console Testing
- Salesforce Lightning Testing
- Salesforce Lightning Web Component (LWC) Locator Support
- Salesforce Release Updates
- Visualforce Testing
- Best Practices
- Salesforce Connection Best Practices
- Improve Your Metadata Performance
- Testing Best Practices
- Automation Planning
- Supported Testing Phases
- Provar Naming Standards
- Test Case Design
- Create records via API
- Avoid using static values
- Abort Unused Test Sessions/Runs
- Avoid Metadata performance issues
- Increase auto-retry waits for steps using a global variable
- Create different page objects for different pages
- The Best Ways to Change Callable Test Case Locations
- Working with the .testProject file and .secrets file
- Best practices for the .provarCaches folder
- Best practices for .pageObject files
- Configurations and Permissions
- Error Messages
- Provar Manager 3.0 Install Error Resolution
- Provar Manager Test Case Upload Resolution
- Administrator has Blocked Access to Client
- macOS Big Sur Upgrade
- Resolving Failed to Create ChromeDriver Error
- Resolving Jenkins License Missing Error
- Resolving Metadata Timeout Errors
- Test Execution Fails – Firefox Not Installed
- Selenium 4 Upgrade
- Licensing, Installation and Firewalls
- Test Builder and Test Cases
- Release Notes