Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & Test Observability

Integrate BrowserStack Automate with QMetry

This document guides you with the step-by-step process to run QMetry tests on BrowserStack.

Introduction

QMetry Automation Studio brings omnichannel, multi-language scripting, and reusability to automated testing. It offers scalable test automation that enables an easy transition from manual to automated testing. It supports multi-platform automated testing across web, web services/APIs, mobile, and Windows desktop.

In this guide, you will learn to:

Prerequisites

Running QMetry tests on BrowserStack

Update the remote.server setting and add capabilities in the env.properties file to run your QAS recorded test scripts on BrowserStack.

  1. In QAS, open the test in the Project explorer.
  2. In the explorer view, open the env.properties file in the resource/web directory.
  3. Update the remote.server setting to the BrowserStack hub URL as follows:
    remote.server=https://YOUR_USERNAME:YOUR_ACCESS_KEY@hub.browserstack.com/wd/hub
    
  4. Add the required capabilities to the chrome.additional.capabilities settings in the env.properties file as follows assuming you want to test on the Chrome browser and a Windows 11 device:
     chrome.additional.capabilities={‘os’:’Windows’,’os_version’:’11’,’browser’:’Chrome’,’browser_version’:’latest’,’browserstack.local’:’true’,’selenium_version’:’3.14.0’,’build’:’qmetry-single’,'name': 'chrome'}
    

    Check out the capabilities generator to learn about other capabilities that you can use.

  5. Update the driver.name parameter to the web.config file in the config directory. As in the example we are using the Chrome browser, the driver.name parameter is set to chromeRemoteDriver as follows:
       <suite name="Web Test" verbose="0">
         <test name="Web Test1" enabled="true">
           <parameter name="driver.name" value= "chromeRemoteDriver"/>
             <packages>
               <package name="tests.web"></package>
               <package name="tests.web.*"></package>
             </packages>
         </test>
       </suite>
    
  6. Run your test in your command line.
  7. View your test results on the BrowserStack Automate dashboard.

Testing privately hosted websites

You can test your websites that are hosted privately using the BrowserStack Local testing feature. This section will guide you through enabling Local Testing, and then using it to test websites on your work machines, CI/CD machines/nodes, and other private network configurations.

Enabling Local Testing with Automate is a two-step process:

  1. Establishing a Local Testing connection.
  2. Configuring QAS test scripts so they run through the Local Testing connection.

Establishing a Local Testing connection

You can set up the Local testing connection between your system and BrowserStack cloud using the following steps:

  1. Download the appropriate binary for your system:
  2. Unzip the binary to a folder/directory on your machine.
  3. Open your command-line interface and navigate to the folder containing the Local binary.
  4. Run the binary using the following command:
./BrowserStackLocal --key YOUR_ACCESS_KEY
BrowserStackLocal.exe --key YOUR_ACCESS_KEY

Your machine and BrowserStack Cloud remain connected unless you explicitly end the connection since the Local Testing connection is persistent. Hence, close the connection after test execution is complete.

The Local Testing setup might differ slightly based on your requirements, for example, proxy settings, restricting connections to certain domains, etc. Check out the complete list of flags to set up Local Testing for different environments or network configurations.

Configuring tests to run with Local Testing connection

  1. Record your test using the QAS recorder. Ensure that the site you use to create the test is a private website, such as https://localhost.com, etc.
  2. In the explorer view, open the env.properties file in the resource/web directory.
  3. Add the browserstack.local capability and set it to true in the chrome.additional.capabilities setting as follows:
     chrome.additional.capabilities={
       'os':'Windows',
       'os_version':'11',
       'browser':'Chrome',
       'browser_version':'latest',
       'browserstack.local':'true',
       'selenium_version':'3.14.0',
       'build':'qmetry-local',
       'name': 'chrome'}
    
  4. Run your test in your command line.
  5. View your test results on the BrowserStack Automate dashboard.

Running multiple tests in parallel

In Qmetry, you can achieve parallel testing by adding additional capabilties for the combinations that you want to test on. In this example, we will run a single test script on multiple browser-device combinations, namely Chrome, Firefox, and iOS.

Use the following steps to set required capabilities and run QMetry parallel tests on BrowserStack:

  1. In QAS, import the recorded test.
  2. In the explorer view, open the env.properties file in the resource/web directory.
  3. Add capabilties for each browser-device combination as follows:
      remote.server=https://YOUR_USERNAME:YOUR_ACCESS_KEY@hub.cloud.browserstack.com/wd/hub
      chrome.additional.capabilities={'os':'Windows','os_version':'11','browser':'Chrome','browser_version':'latest','selenium_version':'3.14.0','build':'qmetry-parallel', 'name': 'chrome'}
      firefox.additional.capabilities={'os':'Windows','os_version':'11','browser':'Firefox','browser_version':'latest','selenium_version':'3.14.0','build':'qmetry-parallel', , 'name': 'firefox'}
      ios.additional.capabilities={'device':'iPhone 12','os_version':'14','real_mobile':'true','build':'qmetry-parallel', 'name': 'ios'}
    
  4. Update the driver.name parameter to the web.config file in the config directory. As in the example we are using the Chrome browser, the driver.name parameter is set to chromeRemoteDriver. As in the example, if you want to run Web Test1,Web Test2,and Web Test3 on Chrome, Firefox, and ios respectively, the driver,name entries are as follows:
       <suite name="Web Test" verbose="0" parallel='tests'>
         <test name="Web Test1" enabled="true">
           <parameter name="driver.name" value= "chromeRemoteDriver"/>
             <packages>
                 <package name="tests.web"></package>
                 <package name="tests.web.*"></package>
             </packages>
         </test>
         <test name="Web Test2" enabled="true">
           <parameter name="driver.name" value= "firefoxRemoteDriver"/>
             <packages>
                 <package name="tests.web"></package>
                 <package name="tests.web.*"></package>
             </packages>
         </test>
         <test name="Mobile Web Test3" enabled="true">
           <parameter name="driver.name" value= "iosRemoteDriver"/>
               <packages>
                   <package name="tests.web"></package>
                   <package name="tests.web.*"></package>
               </packages>
         </test>
       </suite>
    

    Note: For parallel tests, you don’t need to set the driver.name setting in the env.properties file.

  5. Run your test in your command line.
  6. View your test results on the BrowserStack Automate dashboard.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Download Copy