Thursday, 25 June 2015

Android Espresso: PerformException: Error performing 'single click' on view 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:

onView(withId(, ViewActions.closeSoftKeyboard());  //this close function from support lib.


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(, ViewActions.closeSoftKeyboard());
try {
} catch (InterruptedException e) {

//close and sleep

No comments:

Post a comment