microsoft / WinAppDriver

Windows Application Driver
MIT License
3.7k stars 1.41k forks source link

Double click is not available in Winappdriver for Java #1435

Open praveenvinnakota opened 3 years ago

praveenvinnakota commented 3 years ago

Hi,

Double click is not available in Winappdriver for Java..

Tried with Action class, but of no use. Is there any alternative or work around for this?

Thanks, Praveen.

shoaibmansoor commented 3 years ago

Hi @praveenvinnakota Another option could be double_tap from TouchActions class.

Please refer this examaple

praveenvinnakota commented 3 years ago

Hi @praveenvinnakota Another option could be double_tap from TouchActions class.

Please refer this examaple

Hi @shoaibmansoor , this is available in c# language bindings, but not for java.. any suggestion please?

shoaibmansoor commented 3 years ago

As per docs, both double_click and double_tap are available. It should be easy to import the respective classes and call the methods:

https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/interactions/Actions.html https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/interactions/touch/TouchActions.html

praveenvinnakota commented 3 years ago

Hi,

No luck with Actions and TouchActions, is there any way or workaround for doubleClick?

Here is the code snippet :

_((RemoteWebElement)lstGameTables.get(i)).click(); TouchActions touchactions = new TouchActions(session); touchactions.doubleTap((WindowsElement)lstGameTables.get(i)); touchactions.perform();

Actions actions = new Actions(session); RemoteWebElement we = (RemoteWebElement)lstGameTables.get(i); actions.moveToElement(we).perform(); Thread.sleep(1000); actions.doubleClick().perform(); Thread.sleep(1000); actions.doubleClick(we).perform();_

Thanks, Praveen.