difference between app-wait-activity and app-activity

1,908 views
Skip to first unread message

Al Villaflor

unread,
Jun 3, 2013, 3:09:35 PM6/3/13
to appium-...@googlegroups.com
Working on an app where if it is used the first time, the user will get an EULA; otherwise it is the main app activity. The problem I am seeing is that the app-wait-activity does not seem to work.  
The logs are always looking for the app-wait-activity and completely fails when it does not find it. I was expecting that if that wait activity exists; act on it otherwise go and see if the app-activity did show up.

I have this on both the desiredcap and when starting appium  --app-package mainActivity  --app-wait-Activity EULA.Activity.

From the log:
info: Waiting for app's activity to become focused
info: Getting focused package and activity
(a bunch of these until I guess it times out)
:: ::::: ::
error: App never showed up as active. appActivity: mainActivity != EULA.Activity
error: Failed to start an Appium session, err was: Error: Appium never showed up as active. mainActivity != EULA.Activity

Is there a way to continue if any of those activity is found?


Al Villaflor

unread,
Jun 3, 2013, 3:11:54 PM6/3/13
to appium-...@googlegroups.com
or at least have a way to clear storage data in android without uninstalling the app.

bootstrap online

unread,
Jun 3, 2013, 3:18:18 PM6/3/13
to Al Villaflor, appium-...@googlegroups.com
It may be worth having a wait for activity array instead of just a
singular activity.
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

bootstrap online

unread,
Jun 3, 2013, 3:18:44 PM6/3/13
to Al Villaflor, appium-...@googlegroups.com
On Mon, Jun 3, 2013 at 3:11 PM, Al Villaflor <alvil...@gmail.com> wrote:
> or at least have a way to clear storage data in android without uninstalling
> the app

Did you run mobile :reset?

Al Villaflor

unread,
Jun 3, 2013, 3:20:30 PM6/3/13
to appium-...@googlegroups.com, Al Villaflor
No. is that available? Are you suggested that I call mobile: reset before the app is exited?

bootstrap online

unread,
Jun 3, 2013, 3:23:16 PM6/3/13
to Al Villaflor, appium-...@googlegroups.com
Mobile reset will clear all app data without uninstalling the apk.
That's the key to making sure app-wait-activity works well.

Dan Cuellar

unread,
Jun 3, 2013, 3:27:31 PM6/3/13
to appium-...@googlegroups.com, Al Villaflor
I second the wait activity array idea. Our app sometimes launches to different states. (e.g. you have an upgrade available, vs. sign up screen vs. the system is down screen)

bootstrap online

unread,
Jun 3, 2013, 3:33:44 PM6/3/13
to Dan Cuellar, appium-...@googlegroups.com, Al Villaflor

Jonathan Lipps

unread,
Jun 3, 2013, 4:47:43 PM6/3/13
to Al Villaflor, appium-...@googlegroups.com
Not currently, no. The current solution is to make sure your app always starts up in the same state. E.g., by using reset or uninstalling/reinstalling the app each time. (--full-reset)

Dan Cuellar

unread,
Jun 3, 2013, 7:35:52 PM6/3/13
to appium-...@googlegroups.com, Al Villaflor
Some of these states, like the server is down, and update available cannot reset by full-reset or fast-reset

Al Villaflor

unread,
Jun 3, 2013, 8:56:34 PM6/3/13
to appium-...@googlegroups.com
U
I agree with Dan. Making the wait activity an array would handle different Astarte up activities plus making it more robust

bootstrap online

unread,
Jun 5, 2013, 5:19:25 PM6/5/13
to Al Villaflor, appium-...@googlegroups.com
This has been added.

On Mon, Jun 3, 2013 at 8:56 PM, Al Villaflor <alvil...@gmail.com> wrote:
> U
> I agree with Dan. Making the wait activity an array would handle different Astarte up activities plus making it more robust
>

Al Villaflor

unread,
Jun 6, 2013, 11:42:36 AM6/6/13
to appium-...@googlegroups.com, Al Villaflor
Does not look like this works.  I have the 0.7.0.  And still failing at:

error: App never showed up as active. appActivity: ui.MainActivity != ui.NewActivity1,ui.NewActivity2,ui.MainActivity
error: Failed to start on Appium session.

Is the csv for app-activity or for the app-wait-activity? And I did try it on both, and it still fails.

bootstrap online

unread,
Jun 6, 2013, 11:52:30 AM6/6/13
to Al Villaflor, appium-...@googlegroups.com
It's only for app-wait-activity. I tested it on my app and it works.
Is your app public?

Al Villaflor

unread,
Jun 6, 2013, 12:01:36 PM6/6/13
to appium-...@googlegroups.com, Al Villaflor
no it is not.

is this the correct format? (no spaces after the commas?
capabilities.setCapability('app-wait-activity', 'ui.activity1,ui.activity2,ui.activity3')

and from the command line
$> appium ....... --app-activity 'ui.activity2' --app-wait-activity 'ui.activity1,ui.activity2,ui.activity3'

bootstrap online

unread,
Jun 6, 2013, 12:17:20 PM6/6/13
to Al Villaflor, appium-...@googlegroups.com
This works for me. https://github.com/appium/ruby_lib_android

post
{
:desiredCapabilities => {
:browserName => "Android",
:platform => "LINUX",
:version => "4.2",
:device => "Android",
:name => "Ruby Console Android Appium",
:app => "/appium/ruby_lib_android/api.apk",
:"app-package" => "com.example.android.apis",
:"app-activity" => "ApiDemos",
:"app-wait-activity" => "hi,invalid,ApiDemos,invalid"

Al Villaflor

unread,
Jun 6, 2013, 12:28:15 PM6/6/13
to appium-...@googlegroups.com, Al Villaflor
hmm. ok. let me try to do some more digging and let you know. what I find.
thanks. bootstrap

Al Villaflor

unread,
Jun 6, 2013, 12:43:35 PM6/6/13
to appium-...@googlegroups.com, Al Villaflor
I retried again. My bad, I thought my app only has 3 activities the most, but apparently I found a fourth one where it was failing.
thanks again for adding this enhancement

bootstrap online

unread,
Jun 6, 2013, 1:08:32 PM6/6/13
to Al Villaflor, appium-...@googlegroups.com
Great! It should also work if there are spaces.
Reply all
Reply to author
Forward
0 new messages