Waiting for app's activity to become focused

518 views
Skip to first unread message

Pramod Sadaphal

unread,
Jul 4, 2013, 6:46:23 AM7/4/13
to appium-...@googlegroups.com
Hi,

Is there any method by which i can focus current activity on my android device which appium uses???
Getting logs,

info: Waiting for app's activity to become focused
info: Getting focused package and activity
info: Getting focused package and activity
info: Getting focused package and activity
error: App never showed up as active. appActivity: com.x.LoginActivity != com.x.LauncherActivity

error: Failed to start an Appium session, err was: Error: App never showed up as
 active. appActivity: com.x.LoginActivity != com.x.LauncherActivity
....


Consider following strange scenario which I tried,

1. In desired capabilities I specified app-package to my package name say com.apppackage
2. Also specified launcher activity in app-activity say LauncherActivity 
3. I ran my test case(on android device), and this launched my application. But my next code failed(finding element, clicking element).
4. Then I saw logs which were like,

info: Waiting for app's activity to become focused
info: Getting focused package and activity
info: Getting focused package and activity
info: Getting focused package and activity

5. Then I thought my app-activity name which I passed in code may be wrong.
6. I changed app-activity name in my code to LoginActivity as this activity name showed to me in log
7. I ran the test case, this time my app not launched, test case failed
8. Then I did some stupid job, this time I specified my app-activity name in code as LoginActivity
9. Launched my app manually
10. Ran my testcase, and its passed!!!!

So, is there any way to focus on my current activity??? By which I can use app-activity as LauncherActivity in my code and then focus on current activity,here LoginActivity now, and execute my further code.

thanks,
Pramod  

   



Al Villaflor

unread,
Jul 4, 2013, 9:19:00 AM7/4/13
to appium-...@googlegroups.com
Use app-wait-activity and list out all of the activity that your app may start with as an array list

App-wait-activity = [ com.x.LauncerActivity, com.x.LoginActivity, etc]

Jonathan Lipps

unread,
Jul 4, 2013, 1:54:21 PM7/4/13
to Pramod Sadaphal, appium-...@googlegroups.com
You need to use app-wait-activity. app-activity launches the app, app-wait-activity is the activity you're waiting for in order to start the test.

--
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.
 
 

Pramod Sadaphal

unread,
Jul 6, 2013, 8:02:43 AM7/6/13
to appium-...@googlegroups.com, Pramod Sadaphal
thanx...worked after adding app-wait-activity.....
Reply all
Reply to author
Forward
0 new messages