You can run mobile tests from a schedule if you have a shell-shared environment with
HCL OneTest™
Performance.
One scenario is that you run the same mobile tests from a schedule. Other options are that you run
the same mobile tests on one mobile device or on multiple mobile devices and emulators in parallel
with different user groups. You can set a variable to specify unique mobile devices for each virtual
user in a group running the mobile tests. The variable can be initialized from a dataset so that
multiple mobile devices are used for each virtual user in a group that is running the mobile tests
.
Before you begin
- Install HCL OneTest
Performance and
HCL OneTest UI
in the same package to work in a shell-shared environment in the same workspace.
- Install the mobile test client on the devices and emulators.
- Record tests on the mobile devices and emulators.
- Run the tests on the devices and emulators before you run the
schedule to ensure that the Android playback-ready AUT and test packages
or the iOS instrumented AUT are correctly installed on those devices
and emulators. See Android
testing overview and iOS testing
overview.
About this task
All steps can be done in the Web UI Test perspective.
The
following scenarios are possible when you run mobile tests from a
schedule:
- No variable is created and no dataset used. When the schedule
is run, the product automatically assigns one device per virtual user.
- Each user group runs a test on a single device that is selected
from a schedule, where a variable is defined with a single selected
device.
- The schedule runs the same mobile tests on multiple mobile devices
and emulators in parallel with different user groups. Here a dataset
contains the devices IDs as variable values, and each virtual user
in a group is assigned a variable value from the dataset).
Note: Loops and compound tests can be used in schedules.
Procedure
- Optional: Add the RTW_Mobile_Selected_Device variable
in each mobile test so that you can choose which mobile devices and
simulators are used to run the test. For details, see Defining
a variable to run a test with a selected mobile device
- Open a mobile test, select the test resources node,
and create a variable container.
- In the wizard that opens, enter the following variable
name RTW_Mobile_Selected_Device. Click OK
- Optional: To enable resource monitoring, create
a variable named rm.collect and set it to true.
To collect data at specified intervals, create rm.collect.interval and
set it to an integer value of 1000 milliseconds or higher. To use
resource monitoring in a schedule, you must also set RTW_Mobile_Selected_Device variable
as mentioned in step 1. If you are running a mobile test
or schedule from IBM® Rational® Quality Manager,
set these variables in the Execution Variables section
in a test case.
- Optional: This step is needed only if variables
are not initialized from a dataset. Set the devices identifiers for
each mobile test in the test variable. In the Initial value area,
select Text and enter the device ID. To do
so, from the Mobile Devices editor, select
the device in the list, and copy the device ID that is available under Device in
the Detailed properties area as it is shown
in the following figures.
Steps 1, 2, and
3 are optional. If you do not use the RTW_Mobile_Selected_Device variable,
the product automatically assigns one device for each virtual user.
The number of virtual users or a percentage of users in the groups
can be defined while editing the schedule, as described in step 5.
- Optional: Set the device IDs for each mobile test in a
dataset:
- Create a dataset and associate the dataset with a
test:
- In the Test Details area, check Datapool
value in the Variable Details area.
- In the Select Data Source wizard, click the
Datapool push button, select a dataset in the list, and click
Select. If the dataset must be created, select Use wizard to
create new Datapool, follow the instructions to create the dataset and click
Finish. For details on the data you can add in the dataset, see Creating a dataset associated with a test. Then, select the dataset in the
Select Data Source wizard, and click Select
.
- After you create a dataset and add data to it, enter
the devices IDs in the first column of the dataset.
- Open the Mobile Devices editor, select
the device in the list, and copy the device ID that is available under Device in
the Detailed properties area.
- Open the dataset and paste the device ID in column 1 as shown
in the following figure. Do it for all devices that are used to run
the test.
- In the Test Navigator, create a
schedule with user groups:
- Click . In Select a
wizard, expand Test and click Performance
schedule.
- Enter or select the name of a project or folder to contain
the schedule, and enter a name for the schedule. Click Next.
- You can modify the default number of users, user groups,
ramp stages. If you use loops in the schedule, click Add
loops to each user group and select the type of loop for
each user group. Click Finish
- In the edited schedule, define the user groups: group
size, behavior. You can set a maximum number of virtual user in the
schedule for each user group: Select Absolute and
enter the maximum number of virtual users to run. For details on the
options, see Adding a user group to a schedule.
- Set the locations for the user groups. If the RTW_Mobile_Selected_Device variable is
not explicitly set, make sure that all of the user groups that contain
a mobile test are run on the same location. The concept of location
is specific to schedules and is explained in Creating a schedule and in Running a user group at a remote location.
- Add the mobile tests to the schedule:
- Open the schedule, click a user group and click
- Select a test and click OK.
- Save the schedule. To run the schedule from HCL OneTest UI:
- Set the devices and emulators to passive mode. See the procedure and recommendations in t_run_wb.html#t_run_wb.
- Click Run Schedule. Run the schedule from the command line, see Running a test or schedule from the command line.
Results
You can see the test results in the web and statistical reports.