0

I have a problem with an application that uses double click control, in the angular page I find an example of how it is implemented and I would like to double click on the example control but I can not get it

The example page is: here together with output.

the button on the bottom has implemented the control with which I need to interact ng-dblclick= getdetails()

I tried to execute the js directly and use actions with xpath but it has not served

IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
js.ExecuteScript("getdetails()");

new Actions(driver).DoubleClick(driver.FindElement(By.XPath("/html/body/div/input"))).Perform();

What I can do?

Thanks for help.

Jadcode
  • 1
  • 3
  • Actions action = new Actions(driver); action.moveToElement(driver.findElement(By.xpath("/html/body/div/input"))).doubleClick().perform(); try this. – Hiten Feb 16 '18 at 04:32
  • Possible duplicate of [How to make mouse double click in JavaScript?](https://stackoverflow.com/questions/47981080/how-to-make-mouse-double-click-in-javascript) – undetected Selenium Feb 16 '18 at 08:39
  • Unable to locate element: {"method":"xpath","selector":"/html/body/div/input"}". It is strange because I wait for the control and the xpath statement copied it directly from the browser :( – Jadcode Feb 16 '18 at 17:03

1 Answers1

0

Try these

new Actions(driver).moveToElemet(driver.FindElement(By.XPath("/html/body/div/input")).DoubleClick().build.Perform();

or

WebElement element= driver.FindElement(By.XPath("/html/body/div/input"));
((JavascriptExecutor)driver).executeScript("arguments[0].dblclick();", element);
Vel Guru
  • 394
  • 1
  • 3
  • 16
  • I have dealt with both forms but it always returns: Unable to locate element: {"method":"xpath","selector":"/html/body/div/input"}". It is strange because I wait for the control and the xpath statement copied it directly from the browser – Jadcode Feb 16 '18 at 13:25
  • please check with xpath – Vel Guru Feb 17 '18 at 16:18