[英]Robotium: How to automate button click in the RecyclerView row?
我正在使用Robotium (版本:5.5.3)。 我在RecyclerView的行中有一個按鈕。 我想自動在特定行上單擊該按鈕。
solo.clickInRecyclerView(index); only automates the clicking of that whole row.
我怎樣才能做到這一點?
getActivity().getFragmentManager().getFragmentAtPosition(count-1)
這將為您提供最高(當前)的片段。 然后將其轉換為所需的fragmnet。 例如。
MyFrag myCurrentFrag = (MyFrag) ....
然后使用它,獲取適配器或recylerview。 獲得所需的recylerview實例后,請使用
RelativeLayout myRel = (RelativeLayout) getchildAt();
Button btn = (button) myRel.findViewById();
btn.performClick();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.