i have to test a function which opens a Messagebox at the end of the code. And because that the Junit test will stop until anybody clicks "OK" on the messagebox. Thats not good, because nobody is near the PC during the test...
How can i solve this problem ? Are there any possibilities to close that box automaticly or terminate the new window ??
Best regards, Steffen
posted 9 years ago
There are at least two solutions:
- use an extension to JUnit, such as Jemmy, to actually check that the box is there, and to click the close button, or
- introduce an indirection, so that you can mock the method call that opens the message box
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus