嗨我是robotium的新手,目前在我的应用程序中测试android“actionbaritems”,我使用了以下代码,
assertTrue(solo.searchText("Log In";));
solo.clickOnButton("Log In";);
solo.waitForActivity(LAUNCHER_ACTIVITY_FULL_CLASSNAME);
assertTrue(solo.searchText("Forgot password?";));
solo.clearEditText(0);
solo.enterText(0, "stest123";);
solo.enterText(1, "123456";);
solo.waitForActivity(LAUNCHER_ACTIVITY_FULL_CLASSNAME);
final EditText editText = solo.getEditText(1); // Create a runnable which triggers the
onEditorAction callback Runnable runnable = new Runnable()
{
public void run()
{
editText.onEditorAction(EditorInfo.IME_ACTION_DONE);
}
}; // Use Solo to get the current activity, and pass our runnable to the UI // thread.
solo.getCurrentActivity().runOnUiThread(runnable);
solo.waitForActivity(LAUNCHER_ACTIVITY_FULL_CLASSNAME);
System.out.println(solo.getCurrentActivity().getLocalClassName().toString());
getInstrumentation().invokeContextMenuAction(getActivity(),3,0);
solo.clickOnText("Nearby";);
solo.sleep(1000);
View actionbarItem1 = solo.getView(2);
solo.clickOnView(actionbarItem1);
我无法点击actionbaritem 谁能告诉我代码哪里出错了?由于我没有apk 的源代码,我无法通过常规方法传递它,有任何替代方法或任何想法我哪里出错了?提前致谢