Performing double-click on an element
Reza Roozbehani
Software Testing Automation Engineer . Java / Rest Assured / Selenium / Jmeter / TestNG / JavaScript / Api Testing / Oracle / Git / Eclipse / IntelliJ / Maven
There will be elements in a web application that need double-click events fired to perform some actions.
For example, double-clicking on a row of a table will launch a new window. We will use the Actions class to perform double-click operations.
To perform a double-click on an element, the doubleClick() method of the Actions class is called. To call this method, we need to create an instance of the Actions class, as shown in the following code:
Actions builder = new Actions(driver);
The doubleClick() method needs the element on which the double-click event will be fired. We can call the doubleClick() method by passing the element, as follows:
builder.doubleClick([WebElement]).perform();