sangmingming / robotium

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

To close all activities opened during test you need to invoke finishOpenedActivities() twice. #224

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a simple layout with just EditText in it.

2. Create a class extended from ActivityInstrumentationTestCase2<> in which you 
create a test method which is just clear the EditText: 
solo.clearEditText(0);
This is required to show soft keyboard. 

3. In your tearDown() method invoke:
solo.finishOpenedActivities();

What is the expected output? What do you see instead?

Expected output: all opened during test activities need to be finished.

Actual result: The soft keyboard hides. In order to close all opened activities 
you need to invoke the finishOpenedActivities() once again.

What version of the product are you using? On what operating system?
ICS 4.0.3

Please provide any additional information below.

Original issue reported on code.google.com by ebelets...@gmail.com on 7 Feb 2012 at 1:23

GoogleCodeExporter commented 9 years ago
Unfortunately there is nothing to do about this. Robotium does not have access 
to the keyboard and therefore it does not know  if it is up or not. Therefore 
it can not change behaviour based on if the keyboard is up or not. You will 
need to use solo.goBack() or similar to make the keyboard dissappear and then 
use finishOpenedActivities(). 

Original comment by renasr...@gmail.com on 8 Feb 2012 at 5:37