java - Trying to check web content on android during Robotium test -


my application service running on background , making changes network traffic. want make test robotium calling web source , checking the page. here code calling web content:

    intent = new intent(intent.action_view);     i.setdata(uri.parse(url));     log.d(tag, "looking text ["+expected+"] @ address ["+url+"]");     getsolo().getcurrentactivity().startactivity(i);     getsolo().waitforwebelement(by.textcontent(expected), timeout, false); 

here few things have tried no result

    bool foundcontent = getsolo().waitfortext(expected));     foundcontent = foundcontent | getsolo().getcurrentwebelements().size() > 0;     foundcontent = foundcontent | getsolo().getwebelement(by.tagname("div"), 0)); 

it enough me when test checks "yeah page contain word porn" or "nope page contain word porn" if possible glad if have access whole page code in string if possible.

my first question here hope ok thank in advance!

p.s.: read solo object have method waitforwebelement returning bool (false when content not present till timeout) in 4.0 in code (using 4.0 jar robotium) , in other reference there void. still working on?


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -