WaitForScreen fails 0.4.0.pre10

66 views
Skip to first unread message

bootstraponline

unread,
Jan 21, 2013, 12:48:13 PM1/21/13
to calabash-android
Step unsuccessful: Screen A not found. Current activity is B
(RuntimeError)

I looked at the screenshot and it's on A, however getCurrentActivity
reports screen B. It appears this is a known issue with robotium. Is
there anything that can be done to WaitForScreen so it works properly?

http://code.google.com/p/robotium/issues/detail?id=179

Jonas Maturana Larsen

unread,
Jan 21, 2013, 3:19:49 PM1/21/13
to calabash...@googlegroups.com
We could use adb for that.

I think something like this would work:
adb shell dumpsys window windows | grep -E 'mFocusedApp'

(Grep would have to be done in a Windows friendly way)

I guess this could also be used to check if the expected external app is started when you expect that - haven't really though it through :)

- Jonas


bootstrap online

unread,
Jan 21, 2013, 4:55:33 PM1/21/13
to calabash...@googlegroups.com
I implemented this.
https://gist.github.com/4589830

bootstrap online

unread,
Jan 22, 2013, 4:14:56 PM1/22/13
to calabash...@googlegroups.com
I used your "focused_activity" code to define a new
"wait_for_activity" method which always detects the correct activity.
It'd be nice to have something similar in the official repository.

Jonas Maturana Larsen

unread,
Jan 22, 2013, 4:57:00 PM1/22/13
to calabash...@googlegroups.com
It will get there. I promise! :)

Maybe it should be named "current_activity" instead because "focused" doesn't make much sense.

- Jonas

bootstrap online

unread,
Jan 22, 2013, 4:57:23 PM1/22/13
to calabash...@googlegroups.com
I agree that makes more sense.

On Tue, Jan 22, 2013 at 4:57 PM, Jonas Maturana Larsen
Reply all
Reply to author
Forward
0 new messages