简体   繁体   中英

How to recognise a dialogue in robotium

I'm new to Robotium as well as Android. I have written some code to test an activity. and that activity is opening a dialogue box. and i'm not able to identify it. I tried solo.getCurrentActivity(), not workes. I tried solo.searchText(). But test is failing.

write code like this

if (solo.waitForActivity("HomePhone", 20000)) {
            if(solo.waitForText("xxx*",1,10000)){
                if(solo.waitForText("ok*",1,5000)){
                    solo.clickOnText("ok*");                    
                }else{
                    solo.goBack();
                }
            }

wait for text is best method for your purpose

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM