Creating an AFT Suite to run Web UI tests on BrowserStack Cloud

You can create an AFT Suite when you want to run multiple Web UI tests on wide range of devices that are available on the BrowserStack Cloud. You can configure the AFT Suite with details of the tests, devices to use, and the location from where the tests must be initiated.

Before you begin

You must have completed the following tasks:
  • Created or recorded Web UI tests for the web application that you want to test.
  • Set up your account to access the BrowserStack Cloud. You must have valid credentials such as the user name, either the host name or the URL of the BrowserStack cloud instance, and an API key to authenticate the connection. This key is available under ACCESS KEY in the BrowserStack dashboard.
  • Noted the IP address of the remote agent computer if the device cloud is connected to the remote computer.

Procedure

  1. Open the UI Test perspective in HCL OneTest UI if it is not already open.
  2. Go to File > New > Other.

    The Select a wizard dialog is displayed.

  3. Perform the following actions in the Select a wizard dialog:
    1. Select the XML File option in the XML folder.
    2. Click Next.

      The projects that contain the tests are displayed.

    3. Select the project where you want to save the XML file.
    4. Enter a name for the XML file in the File name field.
    5. Click Next.
    6. Select the Create XML file from an XML template option.
    7. Click Finish.
      An XML document is displayed for editing in the Source view tab.
      Note: Open the Source view tab if the Design view tab is displayed.
      A sample of the syntax or structure of the XML is as follows:
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <inits id="<any_alphanumeric_value>" type="com.ibm.rational.test.ft.aftSuite">
       <group>
        <tests>
           <test path="<path_to_Web_UI_test_1>"/>
           <test path="<path_to_Web_UI_test_2>"/>
        </tests>
        <browsers>
           <browser name="<name_of_the_browser>" id="<device_cloud_name> : <device_name>"/>
         </browsers>
        <locations>
           <location host="<location_where_test_is_run>"/>
        </locations>
       </group>
      </inits>
      
    Refer to the following table to know the variables for the attributes mentioned in the XML sample:
    Element Attribute Variable Sample value Description
    inits id <any_alphanumeric_value> N2D6E3E008FC11EDAE07D38ACD9588FD Specifies that you can enter any alphanumeric value that helps to identify the XML file.
    test path <path_to_Web_UI_test_1><path_to_Web_UI_test_2><path_to_Web_UI_test_3>

    /UI1/Tests/webapp1.testsuite

    /UI1/Tests/webapp2.testsuite

    /UI1/Tests/webapp3.testsuite

    Specifies the path to the Web UI test in your project.
    Note: You can right-click the test, and then go to Properties > Resource to find the path.
    browser name <name_of_the_browser> Chrome Specifies the name of the browser to be used to run the test on the device cloud.
    id <device_cloud_name> : <device_name> BrowserStack : Google Pixel 7 Pro Specifies the name of the device cloud and ID of the device on the device cloud.
    location host <location_where_test_is_run> localhost Specifies the location as the computer that runs the test. The host can be the computer that is running HCL OneTest UI or the remote agent computer.
  4. Enter the values for the attributes for your tests, device, and location in the XML file.
  5. Save the XML file.

Results

You have created an AFT Suite for Web UI tests, which you can use to run the tests on devices that are on the BrowserStack Cloud.

What to do next

You can initiate a run of the Web UI tests that are in the AFT Suite. See Running Web UI tests as an AFT Suite on BrowserStack Cloud.