the precondition: I'm working on the an开发者_运维技巧droid automated test, so we can not touch the source code of app, but just test it.
the question: How to get the instance of the dialog after it pop up? After we get the instance of it, it will be so convenient for the further operation, like directly set the value of it, instead of send the key event to the activity so many times.
Thanks.
It seems like you're doing "black box testing", which is the domain of such utilities as "Robotium" and "Robolectric". Check them out, they're specifically designed to press buttons, wait for dialogs, accept dialogs and so on.
Dollop, where I work, provides a black box, record-and-play-back tool for Android. It is not limited to running against a single application at a time. It's also easy to configure and use, requires no programming, runs against real devices (which do NOT have to be rooted) and automatically saves screenshots as it plays tests.
精彩评论