Type script action

Type action

When the default Keystrokes recording option is selected, the Recorder records typing in a field on a webpage as one or more Type actions. Each action includes some or all of the text characters echoed in the field. The characters in the field are split across multiple Type actions depending on when network activity occurs between keystrokes, or when a key such as Shift, Ctrl, Alt, Enter, or Meta is pressed.

When the FormFill recording option is selected, typing in a field is recorded as a FormFill action; however, certain keystrokes (such as pressing Backspace, or pressing Tab to move to the next field) are recorded as Type actions.

For each character in a Type action, specific keystroke information is recorded. This includes the character code (for the output of the keystroke), the key code (for the physical key that was pressed), and the selection range start and end (if there is no selection, the start and end of the selection range are identical, representing the cursor position). Because the key codes show the actual keys that were pressed, any mistakes you make while typing are recorded; for example, if you type a character, use the Backspace key, and type another character, the original character and the backspace are recorded along with the correct character.

Element locators are captured and can be edited when necessary.

All values can be edited for an existing Type action.

Insert a new action into an existing script. However, this requires a thorough understanding of your webpage or application. It is often easier to re-record the script to include the action.

The Click action is defined by the following settings:

  • Text – The text that is displayed in the field as a result of what you typed. If a correction (backspace or delete) was captured in the action, the corrected text is displayed.

  • Keystrokes – All the keys you pressed while the action was being recorded, including any corrections.

  • Keystroke Modifiers – Shift, Control, Alt, or Meta

  • Target Window – The window where the click occurs.

  • Locators – The elements to be clicked.

Type settings

Edit the captured text

  1. Add or delete characters in the Text field.
    You can use evaluation syntax.

  2. Add or delete the corresponding keystroke entry for each added/deleted character. You can also delete corrections, i.e. an incorrect character and a backspace.

To add a keystroke, you must know the character code and key code that defines the character. Click the add icon Add icon to add a new row in the Keystrokes area. Type the character code and key code in the appropriate fields; when you add the character code, the character it defines appears on the left side of the row. If necessary, change the selection range to select the typed character; the default is 0–0 (no selection).

To delete a keystroke, click in the row for the keystroke.

Edit the element locator information

  1. Edit the Target Window field if necessary.

  2. Add or delete Locators.

To add a locator, click to add a row. Select CSS or DOM — in the drop-down list. Enter the location value in the field to the right of the drop-down list.

To delete a locator, click in the row.

Specify parameter syntax

The Apply Parameter option is only available if you have defined parameters in the script.

  1. Click Apply Parameter to the right of the Text field. The possible parameters appear in a drop-down list.
    Apply parameter

  2. Select the parameter to apply. The parameter syntax for the selected parameter appears in the Text field.
    Parameter applied to text field