简体   繁体   中英

How can I use Robotium Test to extract variable value of a Fragment?

I have a Fragment which sets a certain value inside a Fragment. It does not put it in a UI element but its a stored value. How can I extract his value using Robotium solo object? The examples I see are all about testing UI elements, but what if the value is a variable of the Fragment?

I think i cover most of this here: How do I get a reference to a fragment from within a unit/robotium test?

but there is one thing that does not cover, and that is that you will have to unsafely cast the fragment you receive into the fragment class that you have a method to call in order to get the value or alternatively use reflection on the fragment returned to peek into the internal state (I vote you go for option one)

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