Introduction
BrowserStack is a cloud environment that allows running tests in the cloud using different combinations of operating systems, browsers, and browser versions. In this environment, all tests are executed on BrowserStack VM. You can view the ongoing tests execution on BrowserStack.
For more information about BrowserStack, click here.
Prerequisites
Before you start offline execution on BrowserStack, ensure you have:
- An active account with valid Username/Access Key and. If you don’t have an account, then you need to create an account first using this link https://www.browserstack.com/users/sign_up
- Sufficient balance of execution hours
Info |
---|
BrowserStack does not support all Selenium versions. Qualitia users can use the browserstack.selenium_version capability to specify the version they want to use when executing test cases. |
Execution Guidelines
To execute tests on BrowserStack, follow these steps:
- Sign into your BrowserStack account.
- Select the language of your choice (e.g. Java).
- Select Operating System and Browser from the Configure the browser or device combinations section.
Here is a sample program:
{
"server": "hub.browserstack.com",
"user": "shrushti_A6iJC8",
"key": "nnzynAMTyAbwPypxLfj7",
"capabilities": {
"build": "browserstack-build-1",
"name": "parallel_test",
"browserstack.debug": true
},
"environments": {
"env1": {
"browserName": "Chrome",
"browserVersion": "103.0",
"os": "Windows",
"osVersion": "11"
},
"env2": {
"browserName": "Firefox",
"browserVersion": "102.
- 0",
"os": "Windows",
"osVersion": "10"
},
"env3": {
"browserName": "Safari",
"browserVersion": "14.1",
"os": "OS X",
"osVersion": "Big Sur"
}
}
}The URL format is as follows:
URL = "https://" + USERNAME + ":" + AUTOMATE_KEY + @hub-cloud.browserstack.com/wd/hub - Now, open Qualitia Automation Studio and login.
- Go to the Execute tab.
- Click Execution Profile.
- Click the plus icon to add new Execution Profile.
- Provide a name for the Execution Profile.
- Under Execution Configuration > Web Environment select BrowserStack.
- Under Web Execution select BrowserStack.
- In the Desired Capabilities window, enter all the following mandatory fields by selecting the checkbox:
- url
- username
- accesskey
- platform
- os
- os version
Note: Username and Access Key is provided here:
Note: Username and Access Key is provided here:
- assas
- asss
You must create execution profiles that are solely used for execution on Browserstack platform from Qualitia Client or offline package. In those execution profiles, you must define the settings that are mandatory for test suite execution.
Mandatory Settings in the Associated Execution Profile
In the associated execution profile, do the following in the order listed:
- From the Environment list, select Cloud.
- From the Cloud Platform list, select BrowserStack.
- Select the Edit Desired Capabilities checkbox.
- Select or enter the following values:
- Url
- username
- accesskey
Additional Recommendations:
On the Execution Parameters tab, select ScreenCaptureMode as Browser.
Viewing Current Execution on BrowserStack
Once you have triggered the offline execution, you can view the status of your ongoing executions on BrowserStack. BrowserStack considers each Test case as a new project. The status is updated after each project is completed with its status against it. Also, you can filter the projects by their status (Completed, Timeout, or Errors) or you can search it by build name or session name.
You can record your test case execution configuring the browserstack.properties file accordingly. If you set the recordVideo value as true and all the test case executions will be recorded. You can download these videos once the test execution is completed.
Execution Behind Firewall
Sometimes applications are configured to be accessed within private networks. Such applications deny access when they are being accessed from other than local networks and so from BrowserStack. Executing test cases on BrowserStack for such applications needs special configurations.
When executing test case for applications running behind firewall on Windows, you need to execute the BrowserStackLocal.exe file on the machine in the private network to allow BrowserStack to execute tests flawlessly.
To execute test cases for applications running behind firewall on BrowserStack (Windows):
- Make sure you have set the browserstack.local value as true in the Edit Additional capabilities.
- Download the BrowserStackLocal.exe on any machine in the network using the following url:
https://www.browserstack.com/automate/python#setting-local-tunnel - Unzip the folder.
- Open Command Prompt and navigate to the BrowserStackLocal.exe file followed by BrowserStack Access key.
For example:
<Path where the file is saved> BrowserStackLocal.exe --key <BrowserStack access key> - Press Enter.
Once the BrowserStackLocal.exe file is executed successfully, you can execute your Offline tests on BrowserStack environment using the same method mentioned above. When executing test case for applications running behind firewall on Mac, you need to execute the BrowserStackLocal Unix Executable file on the machine in the private network to allow BrowserStack executing tests flawlessly.
To execute test cases for applications running behind firewall on BrowserStack (Mac):
- Make sure you have set the browserstack.local value as true in the Edit Additional Capabilities.
- Download the BrowserStackLocal Unix Executable file on any machine in the network using the following url:
https://www.browserstack.com/automate/python#setting-local-tunnel - Unzip the folder.
- Open Terminal and navigate to the BrowserStackLocal Unix Executable file followed by BrowserStack Access key.
For example:
./BrowserStackLocal --key <BrowserStack access key> - Press Enter.
Once the BrowserStackLocal Unix Executable file is executed successfully, you can execute your Offline tests on BrowserStack environment using the same method mentioned above.
Execution Behind Proxy
Qualitia users can execute the test cases behind a proxy.
In order to execute the test cases behind a proxy, you must configure Proxy Properties in the Edit Additional Capabilities.
Qualitia users can define these properties using the command line as well.
Execution using Browser Capabilities
Selenium allows you setting desired browser specific properties to be used when executing test cases. These properties can be set for offline execution as well. You can provide these browser specific details through browser-capability files. For each supported browser (Firefox, IE, Google Chrome, and Safari) you need to configure the settings in the Edit Additional Capabilities.
Each property file above is a set of all the browser specific properties that Selenium allows you change. If you do not change any property, Selenium uses its default values.
Qualitia gives you provision to set these values for Selenium. Selenium has its own control on what value to use and how to reflect them in Execution Browser. For more information about Selenium Capabilities, refer following links: