I am running UIAutomation for android using Robotium and ActivityInstrumentationTestCase2. I have a test suite with 5 tests. Sometimes my test randomly crash because a test starts, once the previous test has not ended yet. Is there a way to avoid this? is it possible to manually add a 10 second delay before every test to get away from this horrible annoying bug?
EDIT:
public class MyTest<T extends RoboActivity> extends ActivityInstrumentationTestCase2<T>
{
protected Solo solo;
@Override
protected void setUp() throws Exception {
super.setUp();
solo = new Solo(getInstrumentation(), getActivity());
}
@Override
protected void tearDown() throws Exception {
solo.finishOpenedActivities();
try {
solo.finalize();
}
catch (Throwable e) {
Assert.fail(e.getMessage()+ e.toString());
e.printStackTrace();
}
super.tearDown();
}
}