GUI: JS Events
Description
GUI: JS Events step performs the JS events
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
| No. | Field Name | Description |
|---|---|---|
| 1 | Step name | Name of the step. The name must be unique in a single workflow. The data type is string and the field is mandatory. |
| 2 | Web Browser Name | Select any one Web Browser Name from the given list. Note: Select the same web browser name which was selected in Start Browser Step. |
| 3 | Criteria | Criteria 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. |
| 4 | Criteria Value | Specify relevant criteria value for the selected criteria above. |
| 5 | 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 |
| 6 | Iframe Indices | Specify 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. |
| 7 | Iframe Xpath | Iframe 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'] |
| 8 | Frame ID | Provide the current Iframe Id to target a specific iframe to perform the action. Default Value: frameID |
| 9 | Action | Select the action to perform the event. Available options are: - Mouse Events - Keyboard Events - Form Events |
| 10 | Action Type | Select 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 |
| 11 | Bubbles | Indicates 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. |
| 12 | Cancelable | Cancelable 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. |
| 13 | Button | Indicates 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. |
| 14 | Buttons | Indicates 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. |
| 15 | Key | Represents 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. |
| 16 | Keys | Represents 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. |
| 17 | X-Coordinate | Specify the horizontal position to move the mouse on the element. |
| 18 | Y-Coordinate | Specify the Vertical position to move the mouse on the element. |