I am trying to test the application and I need to hide the keyboard because I cannot press a button because of this. So, I added Espresso to build.gradle:
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
and tried using this from the library android.support.test.espresso.action.ViewActions:
ViewActions.closeSoftKeyboard();
Testing succeeds but fails after entering some text in the EditText in my layout. And the keyboard is still there, showing.
PS I realized that it was a keyboard error after reading this answer.
source
share