I am testing a new apk file whose source code is not available. This apk file is having two EditText fileds and a Button.My code is pasted below.@SuppressWarnings("unchecked")
public class TestApk extends ActivityInstrumentationTestCase2
{
private static final String TARGET_PACKAGE_ID="com.calculator";
private static final String LAUNCHER_ACTIVITY_FULL_CLASSNAME="com.calculator.Main";
private static Class launcherActivityClass;
static
{
try
{
launcherActivityClass=Class.forName(LAUNCHER_ACTIVITY_FULL_CLASSNAME);
} catch (ClassNotFoundException e){ throw new RuntimeException(e); }
}
public TestApk() throws ClassNotFoundException{ super(TARGET_PACKAGE_ID,launcherActivityClass); }
private Solo solo;
@Override
protected void setUp() throws Exception
{
super.setUp();
solo = new Solo(getInstrumentation(), getActivity());
}
public void testDisplayBlackBox()
{
//Enter any integer/decimal value for first editfield, we are writing 10
solo.enterText(0, "10");
//Enter any interger/decimal value for first editfield, we are writing 20
solo.enterText(1, "20");
//Click on Multiply button
solo.clickOnButton("Multiply");
//Verify that resultant of 10 x 20
assertTrue(solo.searchText("200"));
solo.getView(R.)
}
@Override
public void tearDown() throws Exception
{
solo.finishOpenedActivities();
super.tearDown();
}
}
when I run this test class I get following error
java.lang.NullPointerException at com.jayway.android.robotium.solo.ViewFetcher.getNonDecorViews
How can I overcome that?
I would like to know which version of Robotium you are using.please try to use Robotium 3.6.jar let us intimate if you are getting any problem.
--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotium-develo...@googlegroups.com.
To post to this group, send email to robotium-...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotium-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Please submit a defect report on this in the issue tracker.
/Renas