mobile: find failing

113 views
Skip to first unread message

Joel Miele

unread,
Jul 18, 2013, 9:39:27 AM7/18/13
to appium-...@googlegroups.com
I'm using mobile: find on a pretty large listView.  The function gets about halfway through the listview before it reverses scroll direction and then eventually fails out.  Any idea why this is happening?

bootstrap online

unread,
Jul 18, 2013, 9:40:30 AM7/18/13
to Joel Miele, appium-...@googlegroups.com
What's the exact mobile find command you're using?
> --
> http://appium.io
> ---
> You received this message because you are subscribed to the Google Groups
> "Appium-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to appium-discus...@googlegroups.com.
> Visit this group at http://groups.google.com/group/appium-discuss.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Joel Miele

unread,
Jul 18, 2013, 10:05:21 AM7/18/13
to appium-...@googlegroups.com, Joel Miele
args = 'scroll', [ [3, name_of_country] ]
$driver.execute_script("mobile: find", args)

bootstrap online

unread,
Jul 18, 2013, 10:18:37 AM7/18/13
to Joel Miele, appium-...@googlegroups.com
We're using scrollIntoView with the default max scroll swipes.
http://developer.android.com/tools/help/uiautomator/UiScrollable.html#scrollIntoView(com.android.uiautomator.core.UiSelector)
http://developer.android.com/tools/help/uiautomator/UiScrollable.html#setMaxSearchSwipes(int)

If setMaxSearchSwipes is called with a large number then it'd probably
work on your app.

I looked at the source for "public boolean scrollIntoView(UiSelector
selector) throws UiObjectNotFoundException {"
https://android.googlesource.com/platform/frameworks/testing/+/master/uiautomator/library/src/com/android/uiautomator/core/UiScrollable.java

It goes to the top and then scrolls down. On a large list, it doesn't
seem ideal to always scroll to the top. You may need a custom method.

Joel Miele

unread,
Jul 18, 2013, 10:33:34 AM7/18/13
to appium-...@googlegroups.com, Joel Miele
The nice thing about the list is it defaults to United States at the bottom, so chances are we're always going to scroll up.  I wrote a custom scrolling solution for now, but I'd like to try setting the max swipes because it would be a lot cleaner to look at.  I would have to use execute script to set the max scrolls?

bootstrap online

unread,
Jul 18, 2013, 10:42:09 AM7/18/13
to Joel Miele, appium-...@googlegroups.com
I opened an issue. It's not currently possible.
https://github.com/appium/appium/issues/896

There's another Java scroll method that already sets max swipes. If
that works for you, then I'll update mobile find so it has a larger
number also.
https://github.com/appium/appium/pull/849/files

Joel Miele

unread,
Jul 18, 2013, 11:57:22 AM7/18/13
to appium-...@googlegroups.com
Scroll to got about 25-30 scrolls in before failing.  It looks like it's actually the appium server timing out because it hasn't received a new command in 60 seconds

info: [ANDROID] [info] Got command of type ACTION
info: [ANDROID] [debug] Got command action: scrollTo
info: Didn't get a new command in 60 secs, shutting down...

Also, since I had to pull latest from master, my app doesn't open (I keep manually clicking it).  Did anything change that would require me to change my desired capabilities in the last month or two?

Joel Miele

unread,
Jul 18, 2013, 12:03:58 PM7/18/13
to appium-...@googlegroups.com
Through trial and error it turns out I now need the period before the activity name... so just the server time out issue now.

bootstrap online

unread,
Jul 18, 2013, 12:26:29 PM7/18/13
to Joel Miele, appium-...@googlegroups.com
Please open an issue on GitHub so this gets fixed.

Jonathan Lipps

unread,
Jul 18, 2013, 12:54:55 PM7/18/13
to Joel Miele, appium-...@googlegroups.com
You can set the command timeout using "mobile: setCommandTimeout"

On Jul 18, 2013, at 12:03 PM, Joel Miele <jmi...@snap-interactive.com> wrote:

Through trial and error it turns out I now need the period before the activity name... so just the server time out issue now.

Jonathan Lipps

unread,
Jul 18, 2013, 4:37:25 PM7/18/13
to Joel Miele, appium-...@googlegroups.com
That's not technically impossible, but for what it's worth we're probably going to remove scrollTo from the spec at some point, and replace it with autoscrolling to elements you want to find. I'm hesitant to put a lot more work into this right now for that reason.

On Jul 18, 2013, at 10:25 AM, Joel Miele <jmi...@snap-interactive.com> wrote:

Is it possible to modify find and scrollTo to send a small update to the server on each swipe just to remind it it's running?

Joel Miele

unread,
Jul 18, 2013, 4:42:32 PM7/18/13
to appium-...@googlegroups.com
Fair enough, the current implementation I put together works so I will leave as is until I have a chance to prettify is later on.
Reply all
Reply to author
Forward
0 new messages