Ben, Espresso kullanarak bir test yapıyorum ilk ben eylem çubuğunu açmak: Tamamtıklamak
openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext());
Everything kadar burada, ama sonra bir seçenek menüsüne tıklayın istiyorum:
onView(withId(R.id.action_menu)).perform(click());
menü düzeni xml kimliğine sahip bir seçenek vardır: "action_menu". Ben kullanarak çalışmak için bu adımı var
android.support.test.espresso.NoMatchingViewException: No views in hierarchy found matching: with id: ***.********.******.android.debug:id/action_menu
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.support.v7.widget.ListPopupWindow$DropDownListView{43fd3f58 VFED.VC. .F...... 24,24-612,168}
:
bir hata alıyorum
onView(withText(R.string.action_report)).perform(click());
olsa id ile yanlış neler olduğunu bilmek istiyorum.
Herhangi bir fikrin var mı?
madde gerçekten var mı id = "@ + id/action_menu"? WithText eşleştiricisinden, report_action gibi daha spesifik olabileceğinden bahseder. – siger
Merhaba siger, evet öğenin kimliği var: android: id = "@ + id/action_menu" 'ancak espresso sadece metinle buluyor. Hala nedenini bilmiyorum ... –