Espresso - typeText not working

前端 未结 10 1312
名媛妹妹
名媛妹妹 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:35

    Adding closeSoftKeyboard() after typeText() worked for me.

    CODE:

    onView(withId(R.id.editTextUserInput))
                .perform(typeText(STRING_TO_BE_TYPED), closeSoftKeyboard());
    

    This is how it is documented in the Android docs.

提交回复
热议问题