私のアンドロイド計測器テストでは、ページビューから外れているリサイクルビューをタップしようとしています。この要素にスクロールして、それをタップしたいと思います。私はこれを行うとき、私は、コードリサイクラビューでscrollToを使用しているエラーエスプレッソアンドロイドテスト
onView(allOf(withId(R.id.offerSummaryLayout), hasDescendant(withText("Online deal")), FirstViewMatcher.firstView())).perform(scrollTo(), click());
を書かれている
は、しかしそれは、このエラー android.support.test.espresso.NoMatchingViewException: No views in hierarchy found matching: (with id: uk.co.myAPP.android.beta:id/offerSummaryLayout and has descendant: with text: is "Online sale" and is the first view that comes along) If the target view is not part of the view hierarchy, you may need to use Espresso.onData to load it from one of the following AdapterViews:android.widget.GridView{3395c7d VFED.VC.. .F...... 0,120-768,700 #7f1000b9 app:id/main_categories_grid_view}
は、他の誰がこの問題をexpereincedか、私は
として使用できます。[RecyclerViewActions](https://developer.android.com/reference/android/support/test/espresso/contrib/RecyclerViewActions.html)を利用してください。 – azizbekian
クリックしたいアイテムが表示されていないので、次のようなことをしたい場合があります:onView(withId(recyclerViewId))。perform(scrollToPosition(position)); –
Visual Studioを使用していますか?そうでない場合は、質問から "coded-ui-tests"タグを削除してください。 – AdrianHHH