Adding user actions in a test from smartshots
When you want to add user actions as steps in an existing Web UI test, you can add such steps from smartshots associated with the test. You can select a graphical element in the smartshot and add a user action for that element.
Before you begin
- Ensured that you are assigned a Team Space Owner, Project Owner, or Member with a Tester role to create or edit a test resource.
- Read and understood the information in Edit branch overview and Create or select an Edit branch.
- Ensured that your project contains a Web UI test.
- Opened the test in Test Editor. See Editing a Web UI test.
About this task
Procedure
-
Click the
button displayed on the Test
Editor page.
The Edit button appears only when no active edit branch is selected.
Alternatively, right-click the test in the test navigator panel and select Edit.
The Edit branch dialog is displayed.If the Edit branch dialog is not displayed, then go to step 3. - Select an existing branch or create a new branch.
-
Drag and drop one of the following element from the UI catalog
in the Catalog tab after the required step.
- Verify
- Assign
- Click
- Type
- Select
-
Click the newly added step.
The step details pane is displayed.
-
Select one of the panes and perform the following actions:
Name of the pane Action Smartshot Hover over a UI element in the Smartshot view, right-click, and then select one of the following options: - Use this element as a step target
- Create user action for this element: Click, Select, Type, Verify, Assign
Elements Perform the following actions: - Expand the list of elements in Elements.
- Select an element, right-click, and then select one of the following
options:
- Use this element as a step target
- Create user action for this element: Click, Select, Type, Verify, Assign
Properties Perform the following actions: - Click any of the UI elements in the Smartshot view.
- Select a property from the Properties list,
right-click, and then select one of the following options:
- Add property to step target
- Create user action with this property: Click, Select, Type, Verify, Assign
If the target object is already defined, then you can use the Replace property in step target option to replace the identifier.
If you selected the Use this element as a step target option, the action or condition is assigned to the selected element. Else, if you selected the Create user action for this element option with one of the listed actions, a step is added just before the selected step.The step details pane is displayed with the Smartshot, UI Object type, Action, and Object Identified By details. The values displayed are dependent on the object selected.
Alternatively, you can select the Code checkbox, and then enter a JavaScript code that returns the target object for the selected action.
- Optional: Click the Click here to add relative to link, specify the relative location in the Location field, and then specify the relative object in the UI Object field.
- Optional: Click the Click here to add alternative identifier link, and select a target object from the list in the Target 2 field.
-
Click the Save icon
to save the modifications.
Results
What to do next
- Run the test and view the results. See Running a Web UI test.
- Add additional steps from the catalog. See New test steps from the General catalog, New steps for UI-related actions and user actions in a test from the UI catalog, and Adding conditional logic and redefining the flow in tests from the Flow catalog.
- Create and use variables in the test. See Creating and assigning test variables.