Espresso – typeText not working


I’m trying to type some text inside an EditText:

    public void testSearch() {

I see the EditText is getting focus, but nothing happens. No text is typed.
I tried this on a phone and an emulator – same result.


Looks like I figured out the issue. It had to do with hardware vs software keyboard.

For Emulators:

Go to Settings -> Language & Input -> switch the Default Input to Sample Soft Keyboard.

For Phones:

Install a software keyboard from the Play store and switch to it. It appears that the native keyboards of some phones do not work.

It works now.

Answered By – Eduard

Leave a Comment