"click and hold" with WebDriver

Is it possible to "click and hold" and element with WebDriver? That is, click an element and not release the click.

Answers


With WebDriver 'Actions' we can do that:

Actions clkAndHld = new Actions(driver);
clkAndHld.clickAndHold(WebElement).build().perform();

Actually, for Python Webdriver API (according to tags) it's Action Chains Doc is here

from selenium.webdriver.common.action_chains import ActionChains

element = driver.find_element_by_xpath(xpath)

def click_and_hold(driver, element):
    ActionChains(driver).click_and_hold(element).perform()

WebElement nameofwebelement = driver.find(By.xpath,id,name("")); 
Actions builder = new Actions(driver);   
builder.clickAndHold(nameofwebelement).perform();

Need Your Help

3D Arrays in C and Printing Its content

c arrays multidimensional-array

I'm trying to do something that should be simple. I am making an array that only has 1 element in it. Which is coordinates x y z