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.
Before you start offline execution on BrowserStack, ensure you have:
- An active account with valid Username/Access Key and
- Sufficient balance of execution hours
Configuring qualitia.properties and browserstack.properties
In order to execute test cases on BrowserStack, you need to configure the qualitia.properties file accordingly.
To execute the offline package on the BrowserStack environment:
- Open the qualitia.properties file from the config folder of offline package.
- Set ExecutionEnvironment as browserstack.
Once the qualitia.properties file is updated, you must configure the browserstack.properties file in order to execute offline package in the BrowserStack environment.
To update the browserstack.properties file:
- Open the browserstack.properties file.
- Set properties "custom_username", "custom_accesskey" to valid values with reference to BrowserStack's active user account.
- Set "OS", "OS_Version", "browser", and "version" to the corresponding OS, browser, and browser version that you want your offline package to execute on.
For example, if you want your offline package to execute on Windows 10, Internet Explorer 11 then set keys as follows:
- OS=Windows
- OS_Version=10
- browser=iexplore
- version=11
If you are providing these values through command line, each value should be provided within double quotes if values are containing spaces; otherwise, the spaces in values will result in inconsistencies. For example, java -jar qualitiaoffline-xxx.jar platform="Windows 8.1".
The OS/OS_Version properties override the values set for Platform property. For example, if you have set the OS/OS_Version properties as Windows/10 and the property for Platform is set as Windows 8, then offline Package is executed on Windows/10.
For more information on platforms, browsers, browser versions supported on BrowserStack, see the following: https://www.browserstack.com/list-of-browsers-and-platforms?product=live.
Once all the configuration settings are done successfully, you can now execute test cases on BrowserStack.
Executing Offline Package
You can execute the offline package using traditional method of offline execution.
For more information about offline package execution, please refer to the Offline Package - Execution section.
Values you provide in the browserstack.properties file can also be provided using the Command Prompt window. You can set the BrowserStack properties using three different sources as mentioned below.
browserstack.properties | It is a set of default BrowserStack properties file. You can always use this file to define your own set of properties. |
---|---|
| Qualitia users can create their own properties file for BrowserStack, which includes all the BrowserStack properties. This file can be used by providing command line arguments accordingly when executing offline package. |
Command Line Arguments | Qualitia allows providing BrowserStack properties as command line arguments. For example, java -jar qualitiaoffline-xxxx.jar custom_username=<<BrowserStack user name>> platform=MAC recordVideo=false |
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 Reports
Test execution reports are launched on the machine from where the execution was triggered after the test case execution is completed. You can view the browser type and browser version on the report displayed.
Execution of Tests Running Behind Firewall Applications
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 browserstack.properties file.
- 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 browserstack.properties file.
- 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 using Browser's 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) there is a separate property file present in the Config folder of Qualitia's offline package. Following is the list of files;
- firefoxdc.properties
- googlechromedc.properties
- iexploredc.properties
- safaridc.properties
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.
Changing Browser Capabilities
Selenium uses its own settings for each key that has been commented in the file, except unexpectedAlertBehaviour. Changing properties here overrides the values provided in qualitia.properties / sauce.properties, or selenium's default values. When executing test cases using offline package, you can change some property values providing command line arguments accordingly. But all capability keys do not accept values from command line, hence it is recommended providing values through property files.
To change browser capabilities:
- Open the browserdc.properties file from the config folder of offline package.
- Locate the value you want to change in the file.
- Remove the # sign located prior to the capability.
- Enter the value you want to set for the capability.
For example; if you want to change the version of the browser to be used for test execution, remove the # sign located prior to the version and enter the version number against it.
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:
https://code.google.com/p/selenium/wiki/DesiredCapabilities
https://sites.google.com/a/chromium.org/chromedriver/capabilities
Reports
Execution reports display OS and Browser with their corresponding versions on its summary page along with the execution environment used. For example, if you have chosen execution as Sauce and execution browser as Firefox 42 on Windows 8.1 report is displayed as follows;
- For Execution through remote environment, OS version is not displayed.
- For execution through any environment on Linux, OS version is not displayed.
- For execution on local environment on Windows 8.1, the OS details are shown as 'Windows NT (UNKNOWN)'.