how to scroll down to the bottom of the page?

67 views
Skip to first unread message

alme

unread,
Jul 8, 2016, 8:19:01 AM7/8/16
to calabash-android
how to scroll down to the bottom of the current page?

Note that I do not want to scroll down until it finds a certain view, but I want to scroll until the bottom of the current (displayed) page.

Ivan Ushakov

unread,
Jul 12, 2016, 2:58:58 AM7/12/16
to calabash-android
def scroll_to_top_or_bottom(direction)
 current_screen_state
= query("%_Current_screen_name%") - some label etc

 
begin
 prev_screen_state
= current_screen_state
 
case direction
 
when :up
 scroll
("#{$scroll_view}", :up) - based on how it calls in your app: CustomRecyclerView, RecyclerView etc
 
when :down
 scroll
("#{$scroll_view}", :down) - based on how it calls in your app: CustomRecyclerView, RecyclerView etc
 
end
 current_screen_state
= query("%_Current_screen_name%") - the same line from the beginning of method
 
end while (current_screen_state != prev_screen_state)
end

alme

unread,
Jul 12, 2016, 6:23:10 AM7/12/16
to calabash-android
Thanks for the support. Soon I will test your code. . But first I have to understand how and where to create new methods in calabash-android.
Reply all
Reply to author
Forward
0 new messages