Scroll is not working for an element in Android

scrollTo(String string) is for scrolling to a particular element is having the name or text…

Some elements doesn’t have name like buttons or logos…for those elements, we want to scroll ( like moveToElement(locator) in selenium),is there any possibility???

Thanks in advance!!!

Have you tried this ((JavascriptExecutor) driver).executeScript(“arguments[0].scrollIntoView(true);” , element); command

Thank you @Mayuresh_Shirodkar… I had tried it.but it doesn’t work and it is showing error like below one…

Before moving to Appium, we used uiautomator directly. When we ran across this problem, we create a method that accomplished this as follows:
If element is on screen break
scroll the list using swipe

This generally worked. The problem we had was we didn’t have an easy way to verify we were at the end of the list and terminating with an exception. I suppose we could have checked if the exact same list of elements was available.

Best of luck

1 Like