android - Espresso : how to click one of image in listview? -


help!!!

i want test android ui in espresso, image every time change.

listview  ---framelayout      ---imageview      ---imageview  ---framelayout      ---imageview      ---imageview 

i try way, still can't click:

ondata(is(instanceof(imageview.class)))                 .inadapterview(withid(r.id.listview))                 .atposition(3)                 .perform(viewactions.click()); 

error log:

com.google.android.apps.common.testing.ui.espresso.performexception: error performing 'load adapter data' on view 'with id: <2131296725>'.     @ com.google.android.apps.common.testing.ui.espresso.performexception$builder.build(performexception.java:67) :doubanmovie:connectedandroidtest failed 

i know late others.

 ondata(anything())                 .inadapterview(withid(listviewid))                 .atposition(0)                 .onchildview(withid(childviewid))                 .perform(click()); 

this click on particular view inside listview customlayout


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -