开发者

Robotium : Test two different activity in one test case

开发者 https://www.devze.com 2023-03-03 07:04 出处:网络
I just got started with Robotium and tried to test the android phone andcontactapplication in just one test case.

I just got started with Robotium and tried to test the android phone and contact application in just one test case.

This is the scenario:

1- step

Start the phone application – Dial a number(33323589) – wait (3s) – finish the call- Go back to the phone app. Main screen – select the contacts list tab.

  1. step( in the same test case)

Go to contacts list - Scroll down - select a contact and Dial the number.

The first step works I am able to start the contact application, but not able to play with the contact list. My question is how to start the instrumentation of the contact application when the phone application instrumentation was previously started.

I开发者_运维技巧 try this :

Intent intent = new Intent(Intent.ACTION_MAIN); 
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
intent.setClassName(getTargetContext(), "com.android.contacts.contactsList"); 
Activity activity = startActivitySync(intent); 

has mention in this forum http://groups.google.com/group/robotium-developers/browse_thread/thread/c82a02b4973cbb4d/7a6795ddbcd7c527?show_docid=7a6795ddbcd7c527

unfortunately its not working

please can you help me out of this problem ?

Thank you

Chindji


You can not test two "Applications" at the same time with Robotium. I think in your case Contacts application is one app and Dialing a number is another one. Better you can find the same at Robotium's project hosting site i.e. code.google.com hAppyCoding

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号