Getting exception while calling UiScrollable 'scrollForward()' method


#1

Hi All,

I want to call an android UiScrollable method ‘scrollForward()’.

I am using below command
driver.find_elements(:uiautomator, "new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollForward();")

But while calling this, it perform the scroll event on device but returns an exception Selenium::WebDriver::Error::UnknownCommandError.

Though I am able to call driver.find_elements(:uiautomator, "new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textStartsWith(\"Contact\").instance(0));") and it return proper results.

Please suggest, what I am doing wrong or a way how to call ‘scrollForward()’, ‘flingForward()’ method without exception.

Thanks
Aditya Mandal


#2

Can you post more extensive logs from your Appium server?


#3

The problem here is the usage of “findElement”

The flingForward returns boolean (true false) and the findElement expects to get a Uiselector / UIObject as a parameter …

I was wondering if there a way to execute UIautomator scripts from appium