Appearance
I.doubleClick()
To double click an element or at a position using the left mouse button.
Usage
js
// double click an element at its center
I.doubleClick(element: string)
// double click with an offet from the top-left corner of an element
I.doubleClick(element: string, x: number, y: number)
// double click at a postion from the top-left of the viewport
I.doubleClick(x: number, y: number))Parameters
| Parameter | Type | Description |
|---|---|---|
element | string | The element to click on — by text, CSS, or XPath selector |
x | number | Horizontal offset in pixels from the left edge of the element or viewport |
y | number | Vertical offset in pixels from the top edge of the element or viewport |
Examples
Double click by text
javascript
I.doubleClick("Merlion");This targets an element that best matches the text "Merlion" (case-insensitive), based on:
- the text content of the element,
- associated
<label>elements, - descriptive attributes such as
aria-label,title,alt-text - adjacent text
Double click by CSS
javascript
I.doubleClick("#map-pin");This targets an element that matches the CSS selector #map-pin exactly.
If there are multiple matches, UI-licious will target the element nearest to elements with the most recent interactions.
Click by XPath
javascript
I.doubleClick("//*[@data-test-id='map-pin']");This targets an element that matches the XPath selector //*[@data-test-id='map-pin'] exactly.
If there are multiple matches, UI-licious will target the element nearest to elements with the most recent interactions.
Double click using element offset
javascript
I.doubleClick("#map-pin", 100, 10);This double clicks at an offset from the #map-pin element with an offset of 100px to the right and 10px down from the top-left corner of the element.
Double click using viewport offset
javascript
I.doubleClick(500, 300);This double clicks at 500px right and 300px down from the top-left corner of the viewport (the visible portion of the page).