Espresso - typeText not working

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

    If the EditText does not has the focus yet, you should click on it first. If this solves your problem, then there is no bug.

    onView(withId(R.id.titleInput)).perform(click()).perform(typeText("Engineer"));
    

提交回复
热议问题