| Author |
JUnit: recognise that a MessageBox pops up
|
Steffen Mezger
Greenhorn
Joined: May 11, 2006
Posts: 1
|
|
Hi, 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 ?? Thanks ! Best regards, Steffen
|
 |
Ilja Preuss
author
Sheriff
Joined: Jul 11, 2001
Posts: 14112
|
|
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
|
 |
 |
|
|
subject: JUnit: recognise that a MessageBox pops up
|
|
|