austgl / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

how to close application in tear down using robotium #219

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.how to close application in tear down using robotium
2.solo.finishOpenedActivities() is not closing the app if the tests stops/hangs 
in between the exectuion
3.

What is the expected output? What do you see instead?
It should close the app.

What version of the product are you using? On what operating system?
Robotium 3.0, ADT 15

Please provide any additional information below.

Original issue reported on code.google.com by alpatisu...@gmail.com on 27 Jan 2012 at 7:33

GoogleCodeExporter commented 9 years ago
 Issue 196  says the problem is fixed in Robotium 3.1. I'm still testing that.

But my solution for Robotium 3.0 was to press Back button 15 times in 
tearDown() before I call solo.finishOpenedActivities()

Original comment by airg.aut...@gmail.com on 30 Jan 2012 at 6:11

GoogleCodeExporter commented 9 years ago
In my application, if i press back for 15-20 times some times it says within 
the app, but not closing the app. This affects subsequent tests execution.

I'm using 3.0, what i'm doing tearDown() is closing all the activities. Based 
on the all the opened activities; finishing the activites untill it gets null.

while(solo.getAllOpenedActivities() != null)
  {
    solo.getCurrentActivity().finish();
    i++;
     if (i == 10) 
      {
    break;
      }

  }

Kindly let me know if it works for you.

I've n't tried Robotium 3.1, pls try it and let me know if it works without 
additional modifications in our scripts.

Original comment by alpatisu...@gmail.com on 31 Jan 2012 at 5:27

GoogleCodeExporter commented 9 years ago
This is an application issue. What finishOpenedActivities() does it to finish 
all the activities and then pressing back (just to make sure) that all 
activities are exited. There is nothing more that can be done from Robotium in 
order to finish activities. 

Original comment by renasr...@gmail.com on 31 Jan 2012 at 8:59