Skip to main content

GUI: JS Events

Description

JS Events dispatches native JavaScript events — such as mouse clicks, keyboard key presses, and form events — directly on a web element. Use this step when standard GUI steps do not trigger the expected page behavior because the target element relies on specific JavaScript event listeners to function. You can dispatch Mouse Events (click, dblclick, mouseover, and others), Keyboard Events (keypress, keyup, keydown), and Form Events (focus, blur, change, input, submit), with control over properties such as event bubbling, cancelability, mouse buttons, modifier keys, and coordinates. Note that the event only triggers a response if the target element has a corresponding event handler or supports a default browser action for that event type.

Note
  • Dispatching an event using JS Events, for example, click, keydown and so on, the event only triggers a response if the target element has a corresponding event handler such as an event listener or supports a default browser action for that event.
  • If no handler is defined and there is no native behavior associated with the event type, the event will be dispatched but no action will be performed.

Configurations

Field NameDescription
Step nameName of the step. The name must be unique in a single workflow.
The data type is string and the field is mandatory.
Web Browser NameSelect any one Web Browser Name from the given list.
Note: Select the same web browser name which was selected in Start Browser Step.
CriteriaCriteria is the criterion to locate elements on Web GUI.
GUI Spy can capture the element in the Generate Step dialog. Upon Step Generation, it is populated in the step configuration. You may change criteria by choosing from the list in the Step Generation window or step configuration.
Note: For list and description of criteria values, See Criteria Table.
The field is mandatory.
Criteria ValueSpecify relevant criteria value for the selected criteria above.
Element Index (Starts with 0)Specify the index of the element you want to locate.
Note: One can also specify First or Last.
First, if you want the first element from the located element or, specify Last if you want the last element.
Default Value: 0
Iframe IndicesSpecify Iframe Indices value.
Iframe indices ensure that the target element is identified correctly within the nested frame structure.
You can specify comma-separated values, for example, 0,1,2.
Iframe XpathIframe Xpath is a uniquely generated path that represents the location of an <iframe> or <frame> relative to the top-level window.
Iframe Xpath identifies each frame using a unique attribute such as id, name, or title if available, for example, iframe[@id='mainFrame'].
If no such attributes exist, the frame is identified by its position among sibling frames, like iframe[2] for the second iframe.
For nested structures, each frame is joined in sequence to form a full path. For example, if an element is inside an iframe[@id='outer'], which contains a frameset with a frame[@name='middle'], and that frame contains iframe[@title='inner'], the generated path would be:
iframe[@id='outer'];frame[@name='middle'];iframe[@title='inner'].
Note: If an iframe or frame has no id, name, or title, its origin (i.e., the src URL) will be used as a fallback in the path for unique identification. For example: iframe[@origin='https://example.com']
Frame IDProvide the current Iframe Id to target a specific iframe to perform the action.
Default Value: frameID
ActionSelect the action to perform the event.
Available options are:
- Mouse Events
- Keyboard Events
- Form Events
Action TypeSelect the event to perform on element.
Action Types are different according to the selected action above.
Action types for selected events are: For Mouse Events:
- click
- dblclick
- mouseover
- mouseup
- mousedown
- mousemove
For Keyboard Events:
- Keypress
- Keyup
- Keydown
For Form Events:
- focus
- blur
- change
- input
- submit
BubblesIndicates whether the event propagates upward through the DOM hierarchy from the target element to its root element.
Bubbles: pass true if checked and false if unchecked.
CancelableCancelable indicates if the event’s default browser behaviour can be prevented.
Use stopPropagation() to stop the event from going to parent elements.
Use preventDefault() to block the default action, but only if the event is cancelable.
ButtonIndicates which mouse button was pressed to trigger the event.
For example:
0 = Left button
1 = Middle button (wheel)
2 = Right button
Note: Field is only applicable if the selected Action is Mouse Events and Action type is click, dblclick, mouseup, mousedown.
ButtonsIndicates which combination of mouse buttons are currently being pressed when the event occurs.
It uses a number that represents a combination of buttons:
1 = Left button
2 = Right button
4 = Middle button
Values can be added together for multiple buttons (e.g., 3 means left + right).
Note: Field is only applicable if the selected Action is Mouse Events and action type is click, dblclick, mouseup, mousedown.
KeyRepresents the specific key that was pressed during the event.
Examples:
"Enter" for the Enter key,
"A" for the letter A, "ArrowUp" for the up arrow key
Notes:
- You can provide multiple keys by separating them with commas. For example: Enter, a, b
- This field is only applicable if the selected action is Keyboard Events.
KeysRepresents a combination of keys that are pressed at the same time.
Allowed values are:
- ctrlKey – Indicates whether the Control (Ctrl) key was held down during the key press.
- shiftKey – Indicates whether the Shift key was held down during the key press.
- altKey – Indicates whether the Alt key (Option key on Mac) was held down during the key press.
- metaKey – Indicates whether the Meta key was held down — this is usually the Windows key on Windows or the Command key on macOS.
Note: This field is only applicable if the selected action is Keyboard Events.
X-CoordinateSpecify the horizontal position to move the mouse on the element.
Y-CoordinateSpecify the Vertical position to move the mouse on the element.