Search code examples
c#scrollappium-android

Appium Android 12.0 Samsung Galaxy S22 Ultra and Google Pixel 3 C# - System.NotImplementedException : Unknown mobile command "scroll"


I'm trying to execute scripts for Android, are their any scroll scripts for Android?

I see we have for iOS https://github.com/appium/appium-xcuitest-driver#platform-specific-extensions

driver.ExecuteScript("mobile: scroll", new Dictionary<string, string>() { {"direction","down" } }); 

System.NotImplementedException : Unknown mobile command "scroll". Only shell,scrollBackTo,viewportScreenshot,deepLink,startLogsBroadcast,stopLogsBroadcast,acceptAlert,dismissAlert,batteryInfo,deviceInfo,changePermissions,getPermissions,performEditorAction,startScreenStreaming,stopScreenStreaming,getNotifications,listSms,type commands are supported.

Stack Trace:? RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) RemoteWebDriver.ExecuteScriptCommand(String script, String commandName, Object[] args) RemoteWebDriver.ExecuteScript(String script, Object[] args)

Appium Android 12.0 Samsung Galaxy S22 Ultra and Google Pixel 3 C#

Help in finding scroll script or similar method to scroll to the element in Android Appium.


Solution

  • The command should be "mobile: scrollGesture".

    Here's the documentation: https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/android-mobile-gestures.md#mobile-scrollgesture