Espresso - typeText not working

前端 未结 10 1084
名媛妹妹
名媛妹妹 2021-02-13 22:20

I\'m trying to type some text inside an EditText:


    public void testSearch() {
          onView(withId(R.id.titleInput)).perform(typeText(\"Engineer\"));
          


        
10条回答
  •  不思量自难忘°
    2021-02-13 22:37

    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.

提交回复
热议问题