私は Android を初めて使用し、Robotium を使用していくつかの基本的な Android テストを作成していますが、これは例外として失敗します。
"android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views."
以下は、基本的なテストケースの説明です:-
テストケース:-
public void testSearch() {
Activity a = getActivity();
SearchItemActivity search = new SearchItemActivity(solo);
search.searchText("ipod", a);
}
SearchItemActivity.searchText(String) is defined as
public void searchText(final String search, Activity act) {
Button v = (Button) act
.findViewById(com.test.mobile.R.id.text_search_field);
((Button) v).setText("");
((Button) v).setText(search);
solo.sendKey(Solo.ENTER);
solo.waitForActivity("FoundItemdDetailActivity");
solo.assertCurrentActivity("Expected FoundItemDetail activity","FoundItemdDetailActivity");
}
コードを変更する方法についての提案は高く評価されます