Anna Anna - 1 year ago 62
Android Question

How to scroll a ListView until I see a specific string with Calabash-Android

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

Answer Source

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?
    q = query("TextView text:'#{text}'")

It works for me and I hope it does the same for you!