WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

Windows 10 desktop UWP app scroll issue

Open rameghwa opened this issue 9 years ago • 8 comments

I have a Windows 10 UWP app running on my desktop. It have a list with a group and the group have many items. How can I simulate the scroll up and down of my mouse. I want to get the last element of the list group into view.

rameghwa avatar Jun 07 '17 10:06 rameghwa

couple thoughts, do either of these work for you?

  1. search for all elements in group and send a click to the last one. A click on an element will implicitly scroll the element into view.
  2. use /session/:sessionId/touch/scroll to scroll to bottom

yodurr avatar Jun 12 '17 20:06 yodurr

Suggested point # 2 didn't worked for me. I tried it and nothing happened. As a workaround I am right clicking the first element and then pressing the right arrow via Actions as many times as there are number of elements. That way the focus is shifting to next element with each right click. The elements are lazy loaded and as I scroll via right arrow action the new elements should be discoverable in Appium via FindElementByXPath but that doesn't happen.

rameghwa avatar Jun 13 '17 04:06 rameghwa

Hi @rameghwa,

Can you please try the following test scenario below? https://github.com/Microsoft/WinAppDriver/blob/v1.0-RC/Tests/WebDriverAPI/TouchScroll.cs#L87

This sample demonstrate the use of /session/:sessionId/touch/scroll discussed above.

timotiusmargo avatar Aug 18 '17 22:08 timotiusmargo

@timotiusmargo UWP on desktop does not have touch. I am having similar issue as described here https://github.com/Microsoft/WinAppDriver/issues/279 This should not be closed

db-007 avatar Oct 11 '17 21:10 db-007

Hi @db-007,

UWP on desktop should support touch input. Would you try the test scenario included in our test suite below? https://github.com/Microsoft/WinAppDriver/blob/v1.0-RC/Tests/WebDriverAPI/TouchScroll.cs#L87

timotiusmargo avatar Oct 11 '17 22:10 timotiusmargo

Hi @timotiusmargo

I tried to use the example given above in C# and get a similar one in Java. I tried to use the TouchActions in Selenium-Java to scroll. Below is the code used. TouchActions touchActions = new TouchActions(driver); touchActions.scroll(100, 0);

However, I get the below error. I'm using the latest version of Windows App Driver Jan 11, 2018 11:21:08 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: OSS 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.<init>(TouchActions.java:38) at businessComponents.ContractPageComponents.createNewContract(ContractPageComponents.java:68) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at runners.ParallelRunner.run(ParallelRunner.java:48) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Can you please solve the issue with selenium-java?

ravimidathala avatar Jan 11 '18 17:01 ravimidathala

Hi @ravimidathala,

It looks like the issue you encounter is coming from the local client side (selenium-java). You should raise this issue in their GitHub repository instead for the right community to respond. They may also be able to suggest a workaround that will generate the right JSON wire protocol command to the Windows Application Driver on the remote end.

timotiusmargo avatar Jan 11 '18 23:01 timotiusmargo

Can anybody provide inputs in above issue , even i am also facing the same issue using selenium java?

akhil1809 avatar Jul 16 '18 13:07 akhil1809