How to execute QAS testcase on BrowserStack

This article is intended for QAS users who want to execute test cases on BrowserStack. The test cases recorded from QAS can be executed on the BrowserStack only through the CI/CD mode. Refer to the below steps:

  • Step 1: Once you have recorded a test case in QAS Test Recorder, export the test case code to your project for CI/CD execution. Refer to the help guide for detailed steps.

  • Step 2: Go to the project explorer. Add following BrowserStack properties to resources > web > env.properties file to execute the test case on BrowserStack cloud.

    driver.name=<Remote Driver Name> remote.server=<BrowserStack Hub URL> <driver>.additional.capabilities=<Capabilities>
    • Remote Driver Name: Your desired remote driver to execute your test runs. Refer to this QAF help guide to get the driver’s name.

    • BrowserStack Hub URL: Your BrowserStack hub path. BrowserStack hub paths are generally in the given format: https://<User Name>:<Access Key>@hub-cloud.browserstack.com/wd/hub

    • Capabilities: Set the Capabilities for the driver as per your requirement. Capabilities are a series of key-value pairs that allow you to configure your test runs. Get the BrowserStack Capabilities from here. 

      Sample example for Chrome Driver, Capabilities set for Windows 10 OS, with the latest Chrome version:

      driver.name=chromeRemoteDriver remote.server=https://mark_iLZvnw:FUp8sZCCSv9qmdUxT@hub-cloud.browserstack.com/wd/hub chrome.additional.capabilities={'os':'Windows','os_version':'10','browser':'Chrome','browser_version':'latest','local':'false','selenium_version':'3.14.0','build':'qmetry'}

       

  • Step 3: Run the project using the 'mvn clean test' command. Once the execution is complete, you can check the test case execution details on the BrowserStack. 


For parallel execution on multiple platforms in the BrowserStack, follow the additional steps as below:

  • Step 1: Configure your web_config.xml to run the test case on the desired platforms parallelly. Refer to the help guide for detailed steps.

  • Step 2: Add the capabilities for each platform to the env.properties file.
    Sample example:

    remote.server=https://mark_iLZvnw:FUp8sZCCSv9qmdUxT@hub-cloud.browserstack.com/wd/hub chrome.additional.capabilities={'os':'Windows','os_version':'10','browser':'Chrome','browser_version':'latest','local':'false','selenium_version':'3.14.0','build':'qmetry'} safari.additional.capabilities={'os':'OS X','os_version':'Monterey','browser':'Safari','browser_version':'15.1','local':'false','build':'qmetry','selenium_version':'3.14.0'} firefox.additional.capabilities={'os':'Windows','os_version':'10','browser':'Firefox','browser_version':'latest','local':'false','selenium_version':'3.14.0','build':'qmetry'}

     

  • Step 3: Run the project using the 'mvn clean test' command.


For any further queries, please contact QMetry Support.