Skip to main content

doubleClick

Overview

Use the doubleClick command to perform a double-click on an element.

Usage

await browser.$(selector).doubleClick();

Usage Examples

example.html

<button id="myButton" ondblclick="document.getElementById('someText').innerHTML='I was dblclicked'">Click me</button>
<div id="someText">I was not clicked</div>

doubleClick.js

it("should demonstrate the doubleClick command", async ({ browser }) => {
const myButton = await browser.$("#myButton");
await myButton.doubleClick();

const value = await myButton.getText();
assert.equal(value, "I was dblclicked"); // true
});

References

We'd like to give credit to the original WebdriverIO docs article, from which we drew some information while writing our version.