0
votes

I'm doing test automation for Android devices using Robot Framework and Appium. I'm testing an application not doing my testing with Android devices web-browser. Some of the tests I need to interact with an element, that is very bottom and is not visible at the screen without scrolling down. It seems to be impossible to click any element, if it is not visible at the screen. My problem is, that I don't have any good way to scroll to the right place so that I could be 100% sure, that element is visible at the screen.

I have all ready tried to make a Robot Framework keyword, that could use Swipe, to scroll at the right place.

: FOR    ${counter}    IN RANGE    0    5
\    Swipe    15    600    15    200
\    ${el}    Run Keyword And Return Status     Wait Until Page Contains Element   ${lokalizator}
\    log    ${el}
\    Run Keyword If    ${el}     Exit For Loop
\    ${counter}    Set Variable    ${counter}+1

I'm trying to scroll as long, as it is needed, to see element ( ${lokalizator}) and then stop, but what actually happens, is that scrolling stops immediately, because keyword Wait Until Page Contains Element actually sees element. However, it is not possible to click that element, because it can't be seen at the screen.

1

1 Answers

2
votes

What you have seems close however I'd ...

1) use 'Swipe By Percent' instead of swipe.

2) create a keyword like 'Scroll Down If Element Not Found'. Check screen for an element. If it exist return True. If it doesn't, Swipe By Percent down and return False.

3) no FOR loop. Use wait until keyword succeeds and call your new scroll keyword.