You can modify the step targets in a test from the Mobile
Data view. Two options are available from the menu items.
One is used to modify an action in a test script and assign a new
object as target of the action. The other option is used to define
execution variables for the selected object and give a new value to
the property associated with the object.
Before you begin
You must have created a test from a recording and have the
test script open in the test editor. In the
Rational® Test Workbench Mobile
Test Edition, in the Test Contents area, you must have
selected the action item for which you want to modify the step.
Note: When you run a test from the mobile
client on mobile devices, it uses the same values that you used during
recording. If you modify the test script and create a datapool or
variable, or if you add a condition, a loop, custom code, references
or add other statements, they are not taken into account by the mobile
client at run time. To verify that the initial recorded values are
substituted with variable data, you must initiate the test run from
the workbench.
About this task
This task is applicable to Android, iOS, hybrid and Web UI
applications. You can modify a step target in a test by either assigning
an object as the step target or create a variable assignment from
a propertyName.
Procedure
To assign a new object as step target:
- In the Screen capture view, select
a graphical object or the corresponding element in the hierarchical
list Elements, and then right-click and select Use
this element as step target. In the test
editor, the current step target is replaced by the selected graphical
object.
- In the Test Element Details section,
you can change the action or location initially specified to fit
the new target.
To assign a variable and set a new value for the object’s
property:
- Select an object in the Screen capture or Elements view,
and then right-click and select Create variable assignment
from propertyName.
- In the dialog box, search for a variable that was created
in your test. To do so, enter a name to filter the list of available
variables and click the one matching the name. Click OK.
- Save the test.