简体   繁体   中英

Android & Robotium - Testing that a fragment shows on screen

I have an activity from which i am invoking a fragment A and than again a fragment is introduced from from fragment after clicking a layout which is fragment B, how can i test the views of Fragment B, however easily i can do it for A.

presently what i am doing is

solo.clickOnView(aLayout);
solo.waitForFragmentByTag(TAGOFB, 5000);

And than writing test cases for B's views, but getting null with respect to them , also screen disappears after Fragment A

Today i removed solo.clickOnView(aLayout); and used solo.clickOnText("Text") and everything was working fine, but still however i do not know why this type of behavior was there with solo.clickOnView(aLayout); while things are working with solo.clickOnText("Text")

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