我有一個應用程序,具有的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());
但我有錯誤:
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, root-is-layout-requested=false, has-input-connection=false, x=572.0, y=25.0, child-count=3}"
我想找到「order_untake_jijia_listview_ll」小孩「order_untake_jijia_listview_jia」,但找到它的父親.... –
請重新格式化。 –
我認爲在更新版本的Espresso中,這不再是一個問題。 – 476rick