I have exact same question as the post below, except that I need it to work for Android and the post below is for iOS. I have tried both solutions given in that post, but they don't seem to work for Android. All help is appreciated!
How do i scroll a UITable view down until i see a cell with label "Value" in Calabash
you can add this new step definition and it should do the trick for Android:
Then /^I scroll until I see the "([^\"]*)" text$/ do |text|
q = query("TextView text:'#{text}'")
while q.empty?
scroll_down
q = query("TextView text:'#{text}'")
end
end
It works for me and I hope it does the same for you!
performAction('scroll_down')
In the statement, performAction() is deprecated since calabash 0.5 so not valid with the latest version
My solution will be,
def scroll_until_I_see(id)
until element_exists("* marked:'#{id}'") do
scroll("ScrollView", :down)
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With