Skip to content

Commit a6486c1

Browse files
committed
Add docs for elementHandle.dblclick
1 parent dda27f7 commit a6486c1

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

docs/sources/next/javascript-api/k6-experimental/browser/element-handle.md renamed to docs/sources/next/javascript-api/k6-experimental/browser/element-handle/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ weight: 04
1919
| <a href="https://playwright.dev/docs/api/class-elementhandle#element-handle-check" target="_blank" >elementHandle.check([options])</a> | - |
2020
| <a href="https://playwright.dev/docs/api/class-elementhandle#element-handle-click" target="_blank" >elementHandle.click([options])</a> | - |
2121
| <a href="https://playwright.dev/docs/api/class-elementhandle#element-handle-content-frame" target="_blank" >elementHandle.contentFrame()</a> | - |
22-
| <a href="https://playwright.dev/docs/api/class-elementhandle#element-handle-dblclick" target="_blank" >elementHandle.dblclick([options])</a> | - |
22+
| [elementHandle.dblclick([options])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-experimental/browser/element-handle/dblclick) | Double click on the element. |
2323
| <a href="https://playwright.dev/docs/api/class-elementhandle#element-handle-dispatch-event" target="_blank" >elementHandle.dispatchEvent(type[, eventInit])</a> | - |
2424
| <a href="https://playwright.dev/docs/api/class-elementhandle#element-handle-fill" target="_blank" >elementHandle.fill(value[, options])</a> | - |
2525
| <a href="https://playwright.dev/docs/api/class-elementhandle#element-handle-focus" target="_blank" >elementHandle.focus()</a> | - |
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: 'dblclick([, options])'
3+
excerpt: 'Browser module: elementHandle.dblclick([, options]) method'
4+
---
5+
6+
# dblclick([, options])
7+
8+
Mouse double clicks the element.
9+
10+
<TableWithNestedRows>
11+
12+
| Parameter | Type | Default | Description |
13+
| ------------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
14+
| options | object | `null` | |
15+
| options.button | string | `left` | The mouse button (`left`, `middle` or `right`) to use during the action. |
16+
| options.delay | number | `0` | Milliseconds to wait between `mousedown` and `mouseup`. |
17+
| options.force | boolean | `false` | Setting this to `true` will bypass the actionability checks (`visible`, `stable`, `enabled`). |
18+
| options.modifiers | string[] | `null` | `Alt`, `Control`, `Meta` or `Shift` modifiers keys pressed during the action. If not specified, currently pressed modifiers are used. |
19+
| options.noWaitAfter | boolean | `false` | If set to `true` and a navigation occurs from performing this action, it will not wait for it to complete. |
20+
| options.position | object | `null` | A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used. |
21+
| options.position.x | number | `0` | The x coordinate. |
22+
| options.position.y | number | `0` | The y coordinate. |
23+
| options.timeout | number | `30000` | Maximum time in milliseconds. Pass `0` to disable the timeout. Default is overridden by the `setDefaultTimeout` option on [BrowserContext](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-experimental/browser/browsercontext/) or [Page](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-experimental/browser/page/). |
24+
| options.trial | boolean | `false` | Setting this to `true` will perform the actionability checks without performing the action. |
25+
26+
</TableWithNestedRows>
27+
28+
### Example
29+
30+
{{< code >}}
31+
32+
```javascript
33+
import { browser } from 'k6/experimental/browser';
34+
35+
export const options = {
36+
scenarios: {
37+
browser: {
38+
executor: 'shared-iterations',
39+
options: {
40+
browser: {
41+
type: 'chromium',
42+
},
43+
},
44+
},
45+
},
46+
};
47+
48+
export default async function () {
49+
const page = browser.newPage();
50+
51+
await page.goto('https://test.k6.io/browser.php');
52+
53+
const elementHandle = page.$('#counter-button');
54+
elementHandle.dblclick();
55+
}
56+
```
57+
58+
{{< /code >}}

0 commit comments

Comments
 (0)