I trying to do automation test on android application with Espresso & Java and I want to input text into base_input_view_input in RecycleView in which text of base_input_view_title equal "First name" with layout inspector as bellow:
I tried with this solution but it not work.
onView(withId(R.id.rvBasicInfo))
.perform(RecyclerViewActions.actionOnItem(allOf(withId(R.id.base_input_view_input),allOf(withId(R.id.base_input_view_title),withText("First name"))),typeText("aaaa")));
Here is the log
Caused by: androidx.test.espresso.PerformException: Error performing 'scroll RecyclerView to: holder with view: (view.getId() is
<2131296360/com.test.a.vvv.app.ccc.ccc:id/base_input_view_input> and (view.getId() is
<2131296362> and an instance of android.widget.TextView and view.getText() with or without transformation to match: is "First name"))' on view 'RecyclerView{id=2131296919, res-name=rvBasicInfo, visibility=VISIBLE, width=1080, height=1595, has-focus=false, has-focusable=true,
has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@eb7851f, tag=null, root-is-layout-requested=false,
has-input-connection=false, x=0.0, y=0.0, child-count=7}'.
Please help me to correct the code. Thank you so much!