WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

touchAction.moveToElement(WebElement) does not work

Open AmitVerma4HP opened this issue 8 years ago • 2 comments

I need to moveTo a dynamically generated element on Win10 using JAVA.

Code: TouchActions touchAction = new TouchActions(SettingSession); touchAction.moveToElement(SettingSession.findElement(By.xpath("//ListItem[contains(@Name,'"+ptr_name+"')]")));

Getting this error: java.lang.ClassCastException: io.appium.java_client.windows.WindowsDriver cannot be cast to org.openqa.selenium.interactions.HasTouchScreen at org.openqa.selenium.interactions.touch.TouchActions.(TouchActions.java:38)

AmitVerma4HP avatar May 01 '18 19:05 AmitVerma4HP

This Appium API did the job for Windows Settings Actions action = new Actions(SettingSession); action.moveToElement(SettingSession.findElement(By.xpath("//ListItem[contains(@Name,'"+ptr_name+"')]")));
action.perform();

Closing this issue

AmitVerma4HP avatar May 01 '18 21:05 AmitVerma4HP

Hi @AmitVerma4HP ,

I am facing a similar issue now. I have tried the same code you have attached. However, I could not see it moving to the element but the test has passed.

Also, can you let me know how did you find xpath like this from appium inspector ?

Help is much appreciated.

Thanks Viji

kviji avatar Feb 25 '19 09:02 kviji