Creating an AFT Suite to run mobile tests on BrowserStack Cloud
You can create an AFT Suite when you want to run multiple mobile 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
- Created or recorded mobile tests for the mobile 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 IDs or names of the devices connected to the BrowserStack cloud that you want to use.
- Noted the IP address of the remote agent computer if the mobile cloud is connected to the remote computer.
Procedure
- Open the UI Test perspective in HCL OneTest™ UI if it is not already open.
-
Go to
.
The Select a wizard dialog is displayed.
-
Perform the following actions in the Select a wizard
dialog:
- Select the XML File option in the XML folder.
- Click Next.
The projects that contain the tests are displayed.
- Select the project where you want to save the XML file.
- Enter a name for the XML file in the File name field.
- Click Next.
- Select the Create XML file from an XML template option.
- 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_mobile_test_1>"/> <test path="<path_to_mobile_test_2>"/> </tests> <devices> <device id="<name of the device 1>”/> </devices> <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 Description inits id <any_alphanumeric_value> Specifies that you can enter any alphanumeric value that helps to identify the XML file. test path <path_to_mobile_test_1><path_to_mobile_test_2><path_to_mobile_test_3> Specifies the path to the mobile test in your project. Note: You can right-click the test, and then go to to find the path.device id <name_of_the_device_1> Specifies the name or id of the device that is connected to the device cloud. location host <location_where_test_is_run> 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. -
Create the following elements in the XML document:
Note: You can copy the sample syntax, and then edit the values in the UI. Alternatively, you can create the elements in the XML in the UI.
- <group>
The start and end tags are automatically inserted.
- Create <tests> within the <group> tag.
- Create <test> within the <tests> tag.
- Add the attribute path to the <test> as
follows:
<test path="">
Note: You must enclose all values that you enter for the attributes within a double quotation mark. - Add additional rows for each mobile test.
- Create <devices> within the <group> tag.
- Create <device> within the <devices> tag.
- Add the attribute id as follows:
<device id=""></device>
- Create <locations> within the <group> tag.
- Create <location> within the <locations> tag.
- Add the attribute host as follows:
<location host=""></location>
- <group>
-
Refer to the following table for the values of the attributes that you can
use in the XML file:
Element Attribute Example of a value Explanation test path MyProject\UI1\Tests\apidemos1.testsuite The path in the workspace that contains the project with the test. You can find the path of the test from the Test Navigator by right-clicking the test, and then go to . device id BrowserStack:8D3E35CF16D8D827E4827ABBCD0E582E2761CADA The name of the Android device is 8D3E35CF16D8D827E4827ABBCD0E582E2761CADA that is connected to the BrowserStack Cloud. BrowserStack:R48904TNSAZ The name of the iOS device is BrowserStack : R48904TNSAZ that is connected to the BrowserStack Cloud. location host localhost The host is localhost if the device cloud is connected to the computer that runs HCL OneTest™ UI. 1.20.30.40 The host is the IP address of the remote agent computer, if the device cloud is connected to the remote agent computer. - Enter the values for the attributes for your tests, device, and location in the XML file.
- Save the XML file.
Results
You have created an AFT Suite for mobile tests, which you can use to run the mobile tests on devices that are on the BrowserStack Cloud.
What to do next
You can initiate a run of the mobile tests that are in the AFT Suite. See Running mobile tests as an AFT Suite on BrowserStack Cloud.