How to double click this element using Selenium?


I am working with the following element:

<p class="wrap button draggable" id="anonymous_element_1"><b class="icon" id="handler2"></b>Reports</p>

I have this code so far:


How can I double click on the element?


To double_click on the element you can use double_click() method from ActionChains implementation inducing WebDriverWait for the element_to_be_clickable() as follows:

ActionChains(driver).double_click(WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//p[@class='wrap button draggable' and @id='anonymous_element_1'][contains(., 'Reports')]")))).perform()

Note : You have to add the following imports :

from selenium.webdriver.common.action_chains import ActionChains
from import WebDriverWait
from import By
from import expected_conditions as EC

Answered By – undetected Selenium

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published