Adding UI-related actions and user actions in a test from the UI catalog
When you want to add UI-related actions and user actions to update a test, you can add those steps from the UI catalog. UI-related actions are actions such as opening a new page and adding a new section in the test. User actions are actions such as click, select, type, and key press for user inputs.
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.
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 edit branch or create a new edit branch.
-
Select a user action from the UI catalog in the
Catalog tab to perform the steps as follows:
Catalog element Description Action Verify You can verify the property such as content, type, class, label, exists, tagname, id, xpath, name, and value of a UI object. You can use any property that is listed in the Properties section for verification. When you run the test, Test Hub compares the property of the object that was set in the recorded test with the property of the object during the playback. This comparison helps determine if any changes have occurred in the application, either intentionally or unintentionally.
Perform the following steps: - Drag and drop the Verify element under any test step as required.
- Click the Verify step.
The step details pane is displayed.
- Select an object to be verified by dragging and dropping an element from
Smartshot view, an element from
Elements list, or a property-value pair from the
Properties list.
Alternatively, you can select an object to be verified from the list in UI Object, and then select an identifier such as Class, Content, Label, Xpath, or Id of the object from the list. If you follow this method, you must ensure that the object is highlighted in the Smartshot view after you enter the values.
- Click click here to add a row to provide values to be verified under Verification Points.
- Enter the property name and value to be verified in the newly added row.
- Optional: Click the Click here to add relative to link, specify the relative location in the Location field, and 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.
Alternatively, you can drag and drop an element from the Smartshot view.
- Optional: Select the Override Timeout checkbox in the Advanced tab and increase the timeout value in Duration for the object verification.
Assign You can assign a value to an existing variable or a new variable. Perform the following steps: - Drag and drop the Assign element under any test step as required.
- Click the Assign step.
The step details pane is displayed.
- Hover over a UI element in the Smartshot view,
right-click, and then select Use this element as a step
target.
Alternatively, you can drag and drop a UI element from the Smartshot view to the Object identified by section.
The UI Object type is identified.
- Enter a property name such as Content, Id, or Xpath of the object that
must be used for variable assignment in UI
Property.
If you entered the property name correctly, the value of the property is displayed under Extracted Value.
- Select an existing variable, or Select Add new variable, enter a name for the variable, and then click Add.
With You can add a container for a new page, section, or tab on the web page. Perform the following steps: - Drag and drop the With element under any test step as required.
- Click the With step.
The step details pane is displayed.
- Enter a description of the container in the Note text box.
- Enter a title to identify the container in the Context text box.
Open You can add a step to open a URL. Perform the following steps: - Drag and drop the Open element under any test step as required.
- Click the Open step.
The step details pane is displayed.
- Enter the URL of the page to be opened in the URL text box.
- Select Attach to open the URL in a new tab or window.
- Enter a description about the container in the Note text box.
- Enter a title to identify the container in the Context text box.
Click You can add a click action as a step. Perform the following steps: - Drag and drop the Click element under any test step as required.
- Click the Click step.
The step details pane is displayed.
- Right-click a UI object in the Smartshot pane and
select Use this element as step target.
The UI Object type, Click action, and values for Object identified by are displayed. Optionally, you can modify the values that identifies the object.
- Optional: Select the Click here to add additional identifier link to select one more object that works as an alternative target if the first object was not found.
Select You can add a select action as a step. Perform the following steps: - Drag and drop the Select element under any test step as required.
- Click the Select step.
The step details pane is displayed.
- Right-click a UI object in the Smartshot pane and
select Use this element as step target.The UI Object type, Value, and values for Object identified by are displayed. Optionally, you can modify the values that identifies the object by using one of the following methods:
- Enter the values in the Object identified by fields.
- Drag and drop a Property-value pair from the Properties section.
- Optional: Select the Click here to add additional identifier link to select one more object that works as an alternative target if the first object was not found.
Type You can add a type action for entering the text in a text box as a step. Perform the following steps: - Drag and drop the Type element under any test step as required.
- Click the Type step.
The step details pane is displayed.
- Right-click a UI object in the Smartshot pane and
select Use this element as step target.The UI Object type, Value, and values for Object identified by are displayed. Optionally, you can modify the values that identifies the object by using one of the following methods:
- Enter the values in the Object identified by fields.
- Drag and drop a Property-value pair from the Properties section.
- Optional: Select the Click here to add additional identifier link to select one more object that works as an alternative target if the first object was not found.
Press You can add a press action for window controls or supported keys as a step. For example, you can add a step to minimize a window or press Ctrl + M. Perform the following steps: - Drag and drop the Press element under any test step as required.
- Click the Press step.
The step details pane is displayed.
- Select an option from the Press list.
The Press list displays the Back, Close, Enter, Forward, Keyboard, Maximize, Minimize, Refresh, Reset, Restore, and Tab options. If you selected the keyboard option, then the Modifiers and Key fields are displayed.
- Select one or more modifier keys such as Cmd (only for Mac), Ctrl, Shift, Alt in Modifier.
- Enter a name of the key to be used in combination with the modifier or independently in Key. For example, you can use Ctrl + Home or Home.
- Select the Native System Input checkbox to simulate
the input keys or special key actions at the screen level on the active
window.
This option is used to handle non-HTML windows such as file browse dialogs. To interact with file browse dialogs, you must keep your machine unlocked and the browser dialog must be in the foreground.
-
Click the Save icon
to save the modifications.