Scroll - Appium Library Keyword is not working

Hi,

I am working on Appium automation with Robot framework. Getting an exception while try to use Scroll Keyword in script:

WebDriverException: Message: 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.

Appium Library: 1.5.0.6
RobotFramework: 3.2.1
Python: 3.6.7
Device: Using Mobile lab (Android)

I had checked Appium Library Documentation, there it mentioned, Scroll keyword is available. Screenshot attached for reference.


https://serhatbolsu.github.io/robotframework-appiumlibrary/AppiumLibrary.html

Please provide some solution to scroll webpage in device.

Thanks,

Hi,

Can anyone please provide any solution for Scroll method. I am working on WebApp in which i need to scroll to locate the elements. I had tried all three keywords available in Appium RF library. But they are not working. Throwing exception for same.
Please let me know if anyone has some idea for to resolve this issue.

Thanks,

What version of Appium are you using?

WebDriverException: Message: Unknown mobile command “scroll”. indicates that python code talking to the webdriver fails because the webdriver itself does not implement “scroll” command.

You do not mention which webdriver you mention, eg UiAutomator2 or Espresso …

If you look at GitHub - appium/appium-espresso-driver: Espresso integration for Appium && GitHub - appium/appium-uiautomator2-driver: Appium driver for Android UIAutomator2

Both pages do list commands they support … UIAutomator2 hints that it has mobile: scroll support. Espresso does not.

Judging from the error message you get, you are probably using Espresso ? or neither, or old version where mobile: scroll is not implemented.

Hi,

I am using Appium 1.17.0. i checked RF Appium version:
image

I checked Latest Appium docs for 1.17.0 and it shows that Scroll is no longer implemented but now, TouchAction class is used for Scroll method.
image

But only scroll keyword is available in RF Appium Library
image

So could you please help, is there any way to resolve this issue. It’s a blocker for me.

Thanks,
Gaurav Sharma

You could still try to pass automationName as “uiautomator2” into desired_caps and report back ?

Hi,

I had tried by providing DS as : automationName=uiautomator2, but still it didn’t scroll.

Can you suggest some way to get latest Appium version in RF.

Thanks

@Gaurav I believe those scroll actions were added in Appium 1.18.0, you may need to update:

1 Like

Hey Wolfe,

Thanks for your response, actually i am using RF for Mobile Web Automation. I checked latest Robot Appium library and it shows 1.5.0.7 version,
image

i assume this library doesn’t contain Latest appium verion 1.18.0.

I went through RF appium library Keyword documentation and it shows only three scroll method,
http://serhatbolsu.github.io/robotframework-appiumlibrary/AppiumLibrary.html
image

So i am looking if RobotFramework provides latest appium version 1.18.0. If you can provide any solution to upgrade RF library or any other way to scroll web page.

@Wolfe1 RF Appium Library shows latest version: 1.5.0.7. Does it means that it using Appium 1.5.0.7 only.
Appium latest version is 1.19.0, so if we use Appium server as 1.19.0 and RF Appium Library 1.5.0 then will it be a case of compatibility issue?

I am blocked due to this issue, can you suggest any solution to resolve this issue.

Thanks,

The version numbers between appium-library and appium are not lined up so that assumption is incorrect. I cannot promise that there is compatibility with the latest version of appium but the 1.18.x versions should work just fine.

Appium and appium-libraries versions work independently so you will need to update your appium version to at least 1.18.0

Hi Wolfe

I tried to work on your suggestion, Updated Appium version to 1.18.0, but still Scroll is not working. I had used two Scroll keyword:
Scroll - provided start xpath and end xpath, element are able to locate in DOM but not able to scroll.
Sample Script:
Scroll xpath = //[@class=“open_search_overlay”] xpath = //[@class=“browsebtn”]
NoSuchElementException: Message: An element could not be located on the page using the given search parameters

Scroll Down Keyword: provided xpath but not able to scroll.
Sample Script:
Scroll Down xpath = //*[@class=“browsebtn”]

WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Both strategy and selector arguments must be provided

I had tried on different websites with different locators but none worked for me. Even i tried other Keyword, Press Keyword for page down key but this keyword also not working.

Sample:
Press Keycode 34

Please suggest if you have any suggestion to overcome from this issue.

Thanks,

I am using below script

*** Settings ***
Library AppiumLibrary

*** Test Cases ***
Mobile Web POC
{list} = Create List --start-maximized --disable-web-security --disable-extensions --allow-running-insecure-content --safebrowsing-disable-extension-blacklist profile.default_content_settings.popups download.default_directory --test-type --disable-extensions {args} = Create Dictionary args={list} {desired caps} = Create Dictionary chromeOptions={args} Open Application http://127.0.0.1:4723/wd/hub desired_capabilities={desired caps} platformName=Android deviceName=emulator-5554 browserName=Chrome automationName=uiautomator2
Go To Url https://www.edureka.co/
Sleep 2s
Scroll xpath=//[@class=“open_search_overlay”] xpath=//[@class=“browsebtn”]
#Scroll Down xpath = //*[@class=“browsebtn”]
Capture Page Screenshot

I already included uiAutomation2 cap but still getting issue.

If there is any other way to scroll or version of AppiumLibrary then please do let me know.

Hi,

I am facing the same issue, Scroll keyword not working.
Can anyone help me if you got the solution for the above one

Hey @Gaurav can you share your script to open mobile browser such as chrome browser inside android mobile devices?

many thanks

hi, i use rpaframework 10.3.0 and robotframework-appiumlibrary 1.6.1
it is work fine with scroll

${ANDROID_AUTOMATION_NAME} UIAutomator2
${SALDO-LINK} id=text_balance
${MENU-PULSA} //android.widget.TextView[contains(@text,“Pulsa/Data”)]
Scroll ${MENU-PULSA} ${SALDO-LINK}

just make sure that your both elements are available / you can see in the screen (before scroll)
sometimes if the element is not display on screen, although available in log, the scroll not run.
i hope it can help someone. thx

Hello Guys, I’ve been having some difficulties with the Keyword “Scroll”

When initializing the Keyword, 2 Arguments are required (start_locator & end_locator)

I had understood that the 1_Argument would be the starting point, that is, an element at the top of the screen and the 2_Argument would be an element at the bottom of the screen.

That said, I just reversed it and it worked!

-------------------------------------------------( ^-^)---------------------------------------------- ---------

start_locator_elementDown
end_locator_elementTop

*** Variables ***
${TOP_SCREEN} xpath=//android.widget.TextView[@index= ‘0’ and @text=‘example’]
${DOWN_SCREEN} xpath=//android.widget.TextView[@index= ‘1’ and @text=‘example’]

Scroll ${TOP_SCREEN} ${DOWN_SCREEN}

hope i helped in some way, thanks :wink: