Android的自动测试研究--Robotium(2)

发表于:2013-05-29来源:Csdn作者:xyz_lmn点击数: 标签:Android
//Clicks on Delete in the context menu solo.clickOnText((?i).*?Delete.*); actual = solo.searchText(Note 2); //Assert that Note 2 is not found assertEquals(Note 2 is found, expected, actual); } @Overri

  //Clicks on Delete in the context menu

  solo.clickOnText("(?i).*?Delete.*");

  actual = solo.searchText("Note 2");

  //Assert that Note 2 is not found

  assertEquals("Note 2 is found", expected, actual);

  }

  @Override

  public void tearDown() throws Exception {

  try {

  //Robotium will finish all the activities that have been opened

  solo.finalize();

  } catch (Throwable e) {

  e.printStackTrace();

  }

  getActivity().finish();

  super.tearDown();

  }

  }

原文转自:http://blog.csdn.net/xyz_lmn/article/details/6899905