Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

In this section

Table of Contents

Configuration Settings 

Configuration Settings

In order to execute test cases on BrowserStack, you need to configure the qualitia.properties file accordingly.

In this section

Table of Contents
maxLevel2
minLevel2

To execute the offline package on the BrowserStack environment:

  1. Open the qualitia.properties file from the config folder of offline package.
  2. 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:

  1. Open the browserstack.properties file.
  2. You can either enter the custom_browserstack_url or you can enter custom_username and custom_accesskey.
    (warning) In case you specify both, URL will be used when execution overriding custom_username and custom_accesskey.
    (info) You can configure the custom_browserstack_url using username and access key as shown in the screenshot below.


  3. 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
Note

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.

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.
For more information about supported versions of Selenium, please refer to the BrowserStack documentation.

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.


User-Defined BrowserStack 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.
For example: java -jar qualitiaoffline-x.x.x.jar browserstackfilename="D:\\BrowserStackData
browserstack_version01.properties"

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 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):

  1. Make sure you have set the browserstack.local value as true in the browserstack.properties file.
  2. Download the BrowserStackLocal.exe on any machine in the network using the following url:
    https://www.browserstack.com/automate/python#setting-local-tunnel
  3. Unzip the folder.
  4. 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>
  5. 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):

  1. Make sure you have set the browserstack.local value as true in the browserstack.properties file.
  2. 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
  3. Unzip the folder.
  4. Open Terminal and navigate to the BrowserStackLocal Unix Executable file followed by BrowserStack Access key.
    For example:
    ./BrowserStackLocal --key <BrowserStack access key>
  5. 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 browserstack.properties file as shown in the screenshot below.

Qualitia users can define these properties using the command line as well.

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:

  1. Open the browserdc.properties file from the config folder of offline package.
  2. Locate the value you want to change in the file.
  3. Remove the # sign located prior to the capability.
  4. 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:

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 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 BROWSERSTACK and execution browser as Firefox 55, report appears as follows;

Note
  • 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)'.