我有一个应用程序,有ListView,我想找到LinearLayout,id = order_untake_jijia_listview_jia
代码是:
onData(withClassName(endsWith("ListView")))
.inAdapterView(allOf(withId(R.id.order_untake_jijia_listview_ll), hasSibling(withText("9.0"))))
.atPosition(0).onChildView(withId(R.id.order_untake_jijia_listview_jia));
dataInteraction.perform(ViewActions.click());
Run Code Online (Sandbox Code Playgroud)
但我有错误:
Error performing 'load adapter data' on view '(with id: com.edaixi:id/order_untake_jijia_listview_ll and has sibling: with text: is "9.0")'.
Caused by: java.lang.RuntimeException: Action will not be performed because the target view does not match one or more of the following constraints:
(is assignable from class: class android.widget.AdapterView and is displayed on the screen to the user)
Target view: "LinearLayout{id=2131493753, res-name=order_untake_jijia_listview_ll, visibility=VISIBLE, width=170, height=50, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, …
Run Code Online (Sandbox Code Playgroud)