How to perform double click in selenium webdriver

asked 3 months ago

Double click: Double click in webpage in Selenium web driver can be done using Actions class.

Navigate to https://www.qafeast.com/demo  ,click the double click tab.

Press F12 in the keyboard and inspect the paragraph

 

 

Python:

Double click:

option = driver.find_element_by_class_name("doubleclick-wrap")
actionChains = ActionChains(driver)
actionChains.double_click(option).perform()

 

C#:

Double click:

 IWebElement element = driver.FindElement(By.ClassName("doubleclick-wrap"));
 Actions builder = new Actions(driver);
 builder.DoubleClick(element).Build().Perform();

 

Java:

Double click:

Actions action = new Actions(driver);
WebElement elements=driver.findElement(By.className("doubleclick-wrap"));
action.doubleClick(elements).perform();