Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doubleClick(clickable): does not double click the found element #4149

Closed
rscwcd opened this issue Jun 9, 2017 · 4 comments
Closed

doubleClick(clickable): does not double click the found element #4149

rscwcd opened this issue Jun 9, 2017 · 4 comments

Comments

@rscwcd
Copy link

rscwcd commented Jun 9, 2017

Hi,

We upgraded our system to use Gecko Driver(Version geckodriver-v0.16.1-win64) along with Selenium Web Driver(3.4.0) and FF 53.0. A feature called "Double Click" in our project is not working. We tried many different techniques but till now there is no success in hand. Also, we are not getting any error out of that. Below are the code that we are using to do so :

protected T double_click(By locator) {
WebElement clickable = findElement(ExpectedConditions.elementToBeClickable(locator));
new Actions(driver).moveToElement(clickable).doubleClick(clickable).perform();
return me();
}

The above method is 👎

  1. Able to find the element
  2. Able to click on the element
  3. Not able to generate double click event.
  4. Rest other tests gets fail
    The failure is not specific to any event or project but to all. Please advise.

Also, the classes related to double click in Selenium 3.4.0 is showing deprecated. Could you please let us know the next option we have to use these features ?

@lmtierney
Copy link
Member

This is an issue with geckodriver, please see mozilla/geckodriver#661 for tracking when this is resolved

@rscwcd
Copy link
Author

rscwcd commented Jun 9, 2017

@lmtierney : Hi, Thanks for suggestion, but I didn't find any appropriate answer from the link you shared. Everyone is closing the issue without checking or sharing any appropriate solution for the issue.

Can't understand how busy you guy's are to share the link without checking it for the proper solution.

@lmtierney
Copy link
Member

lmtierney commented Jun 9, 2017

There is no solution at this time, that is why there is an issue created. Sometimes, there isn't an available solution for a problem, which is why they are entered as issues that need to be fixed

@Suresh4328
Copy link

Below solution worked for me.

To DoubleClick an Element

public void doubleClick(WebElement webElement) {

//For FF browser.
((JavascriptExecutor)driver).executeScript("var evt = document.createEvent('MouseEvents');" + "evt.initMouseEvent('dblclick',true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0,null);" + "arguments[0].dispatchEvent(evt);",webElement);

//For IE

//((JavascriptExecutor)driver).executeScript("arguments[0].fireEvent('ondblclick');", webElement);

}

@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants