Write the code to double-click an element

Write the code to double-click an element.

Hello Rhian-lewis,

Here’s the code to double-click an element-

Actions action = new Actions(driver);
WebElement element=driver.findElement(By.id("elementId"));
action.doubleClick(element).perform();