Creating an AFT suite for mobile tests
When you want to run a single mobile test on multiple devices, multiple mobile tests on a single device, or multiple mobile tests on multiple devices that are hosted on a local computer or remote agent computer, you can create an Accelerated Functional Test suite (AFT) suite for mobile tests.
Before you begin
- Connected the devices and configured the emulators or simulators on the computer that runs Rational® Functional Tester or the remote agent computer.
- Been aware of the following details:
- The IP address of the UI Test Agent.
- The port number of the UI Test Agent.Tip: You can hover the cursor over the System Tray to verify that the UI Test Agent is running and also view the port it uses.
About this task
To run the tests as an AFT suite, you must create an XML file where you can specify the test details. You can use this XML file to run these tests anytime later and you can also add more tests, and devices to extend the tests.
Device name | Device id format |
---|---|
Android emulator | Emulator:<Name of Android emulator with
the space replaced with underscore> For example, if the emulator name is Pixel 2 API 30, then device id is Emulator:Pixel_2_API_30 |
Android real device | Android:<Name of Android real device with
the space replaced with underscore> For example, if the real device name is Pixel 4, then device is Android:Pixel_4 |
iOS simulator | Simulator:<Name of iOS simulator_iOS
version> For example, if the iOS simulator name is iPhone 11 Pro and iOS version is 14.4, then device id is Simulator:iPhone 11 Pro_14.4 |
iOS real device | iOS:<Name of iOS device_iOS
version_UUID> For example, if the iOS real device name is My iPhone, iOS version is 14.4, and device UUID is 445f47e79c803c95cd8ef4f2429c61e0b032abdc, then device id is iOS:My iPhone_14.4_445f47e79c803c95cd8ef4f2429c61e0b032abdc |
- The AFT suite must contain either Android tests or iOS tests.
- The AFT suite must contain only mobile tests or a Compound test that contains only mobile tests.
- You cannot run one or more single mobile tests and Compound tests that contain a mix of mobile and Web UI or any other supported tests in an AFT suite.
- Each group can contain only one location. You can use multiple groups to run tests on multiple locations. You cannot have multiple groups for the same location.
- Each group can contain either mobile test scripts only or a Compound test that contains mobile test scripts.
Procedure
-
Create an XML file to specify the details of the test
suites, devices, and the location by performing the
following steps:
- Click
The Select a wizard dialog box is displayed.
. - Select the XML File in the
XML section and then
click Next.
The available projects are displayed.
- Select a project where you want to save the XML file, enter a name for the XML file in the File name field, and then click Next.
- Select the Create an XML file from an XML
template option and click
Finish.
A blank XML document opens.
- Click the Source tab of the XML document.
- Provide the necessary details in the XML file, and
then save the file.
A sample format of the XML file is as follows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <inits id="N3E78C8006B211EB9003B7CBBD8B707A" type="com.ibm.rational.test.ft.aftsuite"> <group> <tests> <test path="<Path of the mobile test1>" /> <test path="<Path of the mobile test2>" /> </tests> <devices> <device id="<Device type1:Device id1>" /> <device id="<Device type2:Device id2>" /> </devices> <locations> <location host = "<local or remote host>" appium.server.host = "<IP address of the UI Test Agent>" appium.server.port = "<Port number of the UI Test Agent>" /> </locations> </group> <group> <tests> <test path="<Path of the mobile test3>" /> <test path="<Path of the mobile test4>" /> </tests> <devices> <device id="<Device type1:Device id3>" /> <device id="<Device type2:Device id4>" /> </devices> <locations> <location host = "<local or remote host>" appium.server.host = "<IP address of the UI Test Agent>" appium.server.port = "<Port number of the UI Test Agent>" /> </locations> </group> </inits>
In the following example, you can see that for each group of tests, you can specify a single location only.
For example,<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <inits id="N04408500ADA11EABD15B2C0CB4A9F45" type="com.ibm.rational.test.ft.aftsuite"> <group> <tests> <test path="/MobileProject1/CmpTest1.testsuite"> </test> </tests> <devices> <device id="Emulator:Pixel_API_29"></device> <device id="Emulator:Pixel_API_30"></device> </devices> <locations> <location host="localhost" appium.server.host="localhost"></location> </locations> </group> <group> <tests> <test path="/MobileProject1/Tests/Copy of APIDemoDebug_Accessibility1.testsuite"></test> <test path="/MobileProject1/Tests/Copy of APIDemoDebug_App.testsuite"/> </tests> <devices> <device id="Emulator:Pixel_3a_API_29"></device> </devices> <locations> <location host="10.115.160.202" appium.server.host="10.115.160.202" appium.server.port="7082" ></location> </locations> </group> </inits>
- Click
- Click OK.
Results
You have created an AFT suite to run mobile tests.