@Override
protected void setUp() throws Exception {
solo.sleep(int time); //fill some long time to see
solo = new Solo(getInstrumentation(), getActivity()); <---- GETS STUCK HERE
}
I have an APK and the app has loading screen first before you see the main screen. When I run the Robotium test project, somehow it stucks in setUp() in line getActivity(). When I tap my application after the loading screen disappears, then the test continues to run.I would like to know why do I need to still tap my app manually just to get the Robotium going ? Is there a workaround here that Robotium can automatically proceed to my test method after the loading screen disappears ?My test project is just the simple one when you create a new Android Test Project. The only difference is the package and activity name. The rest of the code are the default ones you can find in your tutorial for APK page.package com.yourcompany.yourtestname;
import com.jayway.android.robotium.solo.Solo;
import android.test.ActivityInstrumentationTestCase2;
@SuppressWarnings("rawtypes")
public class ReallyBlackboxTest extends ActivityInstrumentationTestCase2 {
private static final String LAUNCHER_ACTIVITY_FULL_CLASSNAME = "com.newsrob.DashboardListActivity";
private static Class<?> launcherActivityClass;
static{
try {
launcherActivityClass = Class.forName(LAUNCHER_ACTIVITY_FULL_CLASSNAME);
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
@SuppressWarnings("unchecked")
public ReallyBlackboxTest() throws ClassNotFoundException {
super(launcherActivityClass);
}
private Solo solo;
@Override
protected void setUp() throws Exception {
solo = new Solo(getInstrumentation(), getActivity()); <---- GETS STUCK HERE
}
public void testLogin(){
// solo.pressMenuItem(0);solo.clickOnText("Login"); <-- MY TEST}
@Override
public void tearDown() throws Exception {
solo.finishOpenedActivities();
}
}
Any help is very muich appreciated! Thank you .
Hi Naveed,Thank you for your reply.
solo.sleep(int time) will not work bec solo isn't initiated yet. BTW, What is AUT ?