double click event code example
Example 1: javascript on double click
document.getElementById("myBtn").addEventListener("dblclick", function() {
alert("Hello World!");
});
Example 2: double click
I would create an action class in order to right click or double click
To perform any actions against web element using actions class,
we need to locate the element first:
WebElement el = driver.findElement
Double Click (doubleClick):
Actions actions = new Actions (driver).perform
actions.doubleClick(el).perform()
actions.moveTo(el).perform actions.doubleClick.perform
actions.moveTo(el).doubleClick().build.perform()
Right Click (contextClick):
actions.contextClick(elementLocator).perform();