android - solo.clickInlist(int) not working for custom listview in Robotium -
i'm new robotium, have 2 questions. 1) i'm trying make click on custom listview item not working. tried clickinlist(int) , clickinlist(int, int).
2) handling random alertdialog: how handle display alert dialog dynamically in robotium? example i'm using alert dialog when message during call webservice, connection failure, no internet, server error, timeout, etc..,
thanks in advance.
there 2 important things note clickinlist(int)
method aren't readily apparent: first, list items 1-indexed, click first item of list, use clickinlist(1)
not clickinlist(0)
. second, clicking relative visible items on screen, clickinlist(1)
click first visible item on list, not first item overall.
as dynamic handling of dialog, arbitrary pop-ups aren't robotium meant handle. it's supposed test user interaction app under known, controlled, repeatable conditions. if unexpected happens in middle of test, such losing connection, should considered failure; there's chance test wouldn't able run completion anyway. hacky work-around, can check existence of dialog before each of events, like:
if(solo.searchtext("dialog text") { //handle closing dialog }
however, i'd advise against this, it'll slow down test considerably, , again, if close dialog, fact error happened in first place going cause later part of test fail.
Comments
Post a Comment