Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2020.2

...

Table of Contents
maxLevel1

User Actions Configuration Overview

To view and modify the action taken by a specific scenario step:

  1. Double-click the scenario step whose actions you want to configure.
  2. In the configuration panel that opens in the right side of the GUI, open the User Actions tab.
  3. Review the existing actions (initially, the ones captured during recording) and modify the settings as needed to specify the actions you want performed. You can choose from the available pre-set actions, or define a custom one.

Using Data Sources to Parameterize User Actions

You can use data sources to parameterize user actions—for instance, to have a type action iterate through a set of different values stored in an Excel spreadsheet.

...


For details on how to add and use data sources to parameterize tests, see Parameterizing Tests with Data Sources, Variables, or Values from Other Tests.

Identifying Elements Associated with User Actions

The element that is the source of a user action will be highlighted with a solid blue border in the scenario step’s Pre-Action Browser Contents tab.

Changing the Target of a User Action

To quickly change the target of a user action, right-click the related element in the Pre-Action Browser Contents tab, then choose the appropriate Modify command.

...

If the user action that you want to change is not associated with a specific element (for instance, a "close" or "navigate" action), click the User Actions tab and choose a new action from the Action drop-down menu to modify the target.

Inspecting the HTML for Elements 

As you create and modify user actions for page elements, you may want to inspect the HTML to determine if you are adding actions to the appropriate elements. 

To see the HTML for an element, right-click the element and choose Inspect <Element> from the shortcut menu.


Understanding Preset Actions

You can configure most common user actions by selecting from the list of preset actions, then customizing them as needed to suit your needs. The available preset actions are described below.

User Actions Tab

The User Actions tab contains configuration settings for many preset user actions. Choose a user action from the Action drop-down menu (see Specifying Specialized Element Locators)and configure the element locator settings.

Element Locator Settings

The element locator settings allow you to specify the element associated with the action. 

...

Many actions allow you to configure Window Name. This allows you to specify the name of the window you would like the action to occur in. Leaving this field blank indicates that the default window will be used.


Specifying Specialized Element Locators (CSS, ALT attribute, etc.)

You can specify a variety of specialized element locators by setting Element Locator to Use XPath, then setting one of the available locator prefixes to the desired value. Available prefixes are:

...

For example, to use the CSS locator tag.classA, use the XPath locator css=tag.classA

Errors for Popup Dialogs

If one of the following types of JavaScript popup dialogs opens in an action other than Accept Script DialogDismiss Script Dialog, or Type into Script Dialog, then an error will be reported unless this is the last test in your scenario:

...

An error will not reported if a popup dialog opens during a wait action .

Accept Script Dialog

This action presses the OK button on any of the three types of JavaScript popup dialogs: alert, confirm, and prompt.

Addselection

For a multiselect combo box, this action adds one option to the selection. This can be the first selection or an additional selection. To select multiple items, use this action multiple times.

Check

This action enables/disables a specified check box element.

Click

This action clicks the specified element.

...

  • Use Key Modifiers to specify if you want to mimic the user pressing the Alt, Ctrl, or Shift keys during the click.

Close

This action closes the specified window.

Dismiss Script Dialog

For popup dialogs (alert, confirm, and prompt), this action either presses the Cancel button (for confirm and prompt) or presses the X (for all 3 types of alert dialogs).

Doubleclick

This action double-clicks an element.

Dragdrop

This action drags one element to another location.

...

  • Move to target element: <some locator, like //div[@id="example"]> Drag the source element by clicking the top-left corner of the source element and dragging to the top-left corner of the target element.
  • Start at offset and move by delta: offsetX,offsetY|deltaX,deltaY Drag the source element starting at offsetX, offsetY from the top-left corner of the source element and moving deltaX, deltaY. Negative deltas move the element up and to the left.

  • Move by delta: deltaX,deltaY Drag the source element by clicking down in the center of the element and moving deltaX, deltaY. Negative deltas move the element up and to the left.
  • Move to offset within element: <some locator>|offsetX,offsetY Drag the source element by clicking the top-left corner of the source element and dragging to a point in the target element offset by offsetX,offsetY from the top-left corner of the target element. Offsets 0,0 would be the top-left corner exactly and would function the same as "Move to target element." Negative offsets would be a point above, or to the left of, the target element's top-left corner.

Execute JavaScript

This action executes the specified JavaScript within the context of the current web page. The specified JavaScript will execute in the same frame as the element defined by the element locator. If no element is defined, the JavaScript will execute in the top-most frame.

...

Note that this code executes the click function on an element. In most cases, this will cause the click behavior to trigger. In some cases, this is insufficient and more code will be necessary to trigger the click.

Go Back

This action presses the browser’s Back button. No arguments are needed.

Go Foward

This action presses the browser’s Forward button. No arguments are needed. 

Hover

This action hovers the pointer over the specified element.

Keydown / Keyup

These actions fires keydown or keyup JavaScript events on an element.

...

  • The element locator specifies the element.
  • The key locator specifies which key is pressed.

Maximize Window

This action maximizes the specified browser window.

...

  • For Chrome on Mac, the Maximize Window action is interpreted as "size-to-best-fit" instead of "fill-screen," so the browser will only maximize vertically. This is the same behavior as if the user clicks the green ‘plus’ button to expand the window.

Navigate

This action navigates to the provided URL as though it was entered in the browser’s URL bar.

...

  • In the URL field, you can enter a FixedParameterized (if a data source is available), or Scripted URL. To enter a scripted URL, select Scripted, then click the EditScript button to enter a script method to return the URL that should be navigated to in the selected action.

Other

Enables you to add a custom action. 

Refresh

This action has presses the Refresh button.

Removeselection

In a multiselect combo box, this action removes one option from the selection. This is the equivalent of shift-clicking on a selected combo box selection.  To remove multiple items, use this action multiple times. 

Right-click

This action right-clicks on the specified element.

Scroll By

This action scrolls the web application by the number of pixels specified for the x and y axis. Negative values indicate "scroll left" (for the x-axis) or "scroll up" (for the y-axis). 

Scroll To

This action scrolls the web application to the specified pixel position (x and y axes).

Select

In a single-select combo box, this action selects a single option in the combo box. If an option is already selected, this action will change the selection.

...

  • You can specify the option to select by the value (defined in the code) or label (shown in the UI as well as defined in the code).

Submit

This action submits a form, or an element within a form, to the remote server.

...

  • Use the element selector to indicate which form to submit (e.g., if there are multiple forms on a page).

Type

This action types the specified text into the specified element.

  • Use Value to specify what text you want typed. You can enter a FixedParameterized (if a data source is available), or Scripted value. To enter a scripted value, select Scripted, then click the Edit Script button to enter a script method to return the value that should be typed in the selected action.
  • If you want to send special characters to the browser, either type them directly into the Value field (valid only when typing produces an output or white space—such as tab, space, semicolon, add, etc.), or use special character mappings as outlined in Modifying User Actions Simulated by a Web Scenario 1Special Character Mappings for Type Actions below.

Type into Script Dialog

This action enters text into a prompt dialog.

...

  • It must be placed immediately after the action that opens the dialog, and followed by an Accept Script Dialog action (which submits the specified text).
  • If you want to send special characters to the browser, either type them directly into the Value field (valid only when typing produces an output or moves the cursor—such as tab, space, semicolon, add, etc.), or use special character mappings as outlined in Modifying User Actions Simulated by a Web Scenario 1Special Character Mappings for Type Actions below.

Type Password

This action types specified text into the specified element. The text will be masked in the field as well as encrypted upon storage.

  • Use Value to specify what text you want typed. You can enter a FixedParameterized (if a data source is available), or Scripted value. To enter a scripted value, select Scripted, then click the EditScript button to enter a script method to return the value that should be typed in the selected action.
  • If you want to send special characters to the browser, either type them directly into the Value field (valid only when typing produces an output or moves the cursor—such as tab, space, semicolon, add, etc.), or use special character mappings as outlined in Modifying User Actions Simulated by a Web Scenario 1Special Character Mappings for Type Actions below.

Uncheck

This action unchecks/clears a checked check box.

Wait

This action simulates the browser waiting the specified number of milliseconds before continuing to the next step.

  • For Milliseconds, specify how long you want the browser to wait. You can enter a FixedParameterized (if a data source is available), or Scripted value. To enter a scripted value, select Scripted, then click the EditScript button to enter a script method to return the value that should be typed in the selected action.

Special Character Mappings for Type Actions

You can use the following special character mappings to specify special characters within type actions:

...