problem with Activity

35 views
Skip to first unread message

Vladimir Marek

unread,
Mar 13, 2013, 7:23:59 AM3/13/13
to robotium-...@googlegroups.com
Hello,

I have problem with identifying current activity.
My application in test [I'm testing apk file directly] has activity A
from which activity B is opened.
in setUp method I do
"solo = new Solo(getInstrumentation(), getActivity());"
and later in test

solo.clickOnText("Test1"); //Test1 text is in activity A
solo.sleep(5000); //now the application should be in activity B
solo.assertCurrentActivity("This is not chat screen!", "B"); // this fails

I tried to check activity using "solo.getCurrentActivity().toString()"
and that returns "A" even if app is already in B activity

I found following issue
https://code.google.com/p/robotium/issues/detail?id=179
but the workaround does not work for me
this code behaves the same

"solo = new Solo(getInstrumentation());"

at the begining of test function
getActivity();
later
solo.clickOnText("Test1"); //Test1 text is in activity A
solo.sleep(5000); //now the application should be in activity B
solo.assertCurrentActivity("This is not chat screen!", "B"); // this fails

I checked the "stack" using the "adb shell dumpsys" and from that it
looks like the B is above the A including the flag "nowVisible=true"

Any idea what I'm doing wrong?

Robotium 3.6 or 4.0; Android 2.3.3 [SDK 10]

Thanks,
Vladimir

Renas Reda

unread,
Mar 13, 2013, 7:27:22 AM3/13/13
to Robotium Developers
Hi,

Please report this issue in the issue tracker.

http://code.google.com/p/robotium/issues/list

/Renas

On Mar 13, 12:23 pm, Vladimir Marek <vladimir.ma...@qnective.com>
wrote:
> Hello,
>
> I have problem with identifying current activity.
> My application in test [I'm testing apk file directly] has activity A
> from which activity B is opened.
> in setUp  method I do
> "solo = new Solo(getInstrumentation(), getActivity());"
> and later in test
>
> solo.clickOnText("Test1"); //Test1 text is in activity A
> solo.sleep(5000); //now the application should be in activity B
> solo.assertCurrentActivity("This is not chat screen!", "B"); // this fails
>
> I tried to check activity using "solo.getCurrentActivity().toString()"
> and that returns "A" even if app is already in B activity
>
> I found following issuehttps://code.google.com/p/robotium/issues/detail?id=179

Vladimir Marek

unread,
Mar 13, 2013, 8:01:56 AM3/13/13
to robotium-...@googlegroups.com
Done - Issue 416.

I found out that the issue might be related to the Android 4.1.2
I was using real device Nexus S running Android 4.1.2 where all those
problems are happening but if I used Samsung Galaxy SII on Android 2.3.5
then it works correctly.

Regards,
Vladimir
Reply all
Reply to author
Forward
0 new messages