Thursday, 25 June 2015

Android Espresso: PerformException: Error performing 'single click' on view




android.support.test.espresso.PerformException: Error performing 'single click' on view 'with id:



What I am testing is very simple:

Just input and click save button down here:






The reason is when you input in the text input, the soft keyboard blocked the screen and it blocks button clicking later.

different solutions from people, but only one works:

1:
onView(withId(R.id.info_storeid_input)).perform(typeText(storeId), ViewActions.closeSoftKeyboard());  //this close function from support lib.

2:

closeSoftKeyboard();    /// this close function from espresso

3:    (works, good solution)

String storeId = "1111\n";   // \n can trigger the keyboard hiding event.

4:  (works, good solution)

onView(withId(R.id.info_storeid_input)).perform(typeText(storeId), ViewActions.closeSoftKeyboard());
try {
    Thread.sleep(1000);
} catch (InterruptedException e) {
    e.printStackTrace();
}

//close and sleep







https://code.google.com/p/android-test-kit/issues/detail?id=44




















No comments:

Post a comment