????Android????????????????????????Instrumentation?????????á??????????????Android????????????Robotium??

????Robotium????????Android App??????????????д??в?????????????????????????Robotium??????????????????????????Activity???????????????????????????????

??????????????????Android Calculator??ó???

????public class NotePadTest extends ActivityInstrumentationTestCase2 {

????private Solo solo;

????public NotePadTest() {

????super("com.android.calculator2"?? Calculator.class);

????}

????public void setUp() throws Exception {

????solo = new Solo(getInstrumentation()?? getActivity());

????}

????@Override

????public void tearDown() throws Exception {

????try {

????solo.finalize();

????} catch (Throwable e) {

????e.printStackTrace();

????}

????getActivity().finish();

????super.tearDown();

????}

????public void testPreferenceIsSaved() throws Exception {

????solo.clickOnText("7");

????solo.clickOnText("\+");

????solo.clickOnText("9");

????solo.clickOnText("=");

????Assert.assertTrue(solo.searchText("16"));

????}

????}