public calculatortest()throws ClassNotFoundException{
super(TARGET_PACKAGE_ID,launcherActivityClass);
}
private Solo solo;
@Override
public void setUp() throws Exception{
solo = new Solo(getInstrumentation(),getActivity());
}
public void testDisplayBlackBox() throws Exception{
//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"));
}
@Override
public void tearDown() throws Exception {
try {
solo.finalize(); //Robotium will finish all the activities that have been open
} catch (Throwable e) {
e.printStackTrace();
}
getActivity().finish();
super.tearDown();
}