Handling unexpected Dialogs
Posted: Tue Nov 13, 2012 8:44 am
Hi,
we've got one MessageBox which appears some time after starting the application. It is not possible to say when this dialog appears. I was following your blog entry http://www.ranorex.com/blog/handling-di ... up-windows - but not successfully. At the moment my tests fail if this dialog pops up because the testexecution continues during the moment I'm dealing with the pop-up and the action of the test fails.
Here a short description what I've done:
- We are working with Testsuites
- Within the testsuite I call a module "StartApp"
- I created a new class with a method which creates a new thread checking if the dialog appears and handling it.
- This method is called during "StartApp"
My Problem is now, how to "pause" the main thread if the Dialog is found, so I can handle the dialog without interrupting the testexecution. I searched but did not find a solution how to access the main thread.
Has someone an idea how to do this?
Thank you in advance
Best regards
Anja
we've got one MessageBox which appears some time after starting the application. It is not possible to say when this dialog appears. I was following your blog entry http://www.ranorex.com/blog/handling-di ... up-windows - but not successfully. At the moment my tests fail if this dialog pops up because the testexecution continues during the moment I'm dealing with the pop-up and the action of the test fails.
Here a short description what I've done:
- We are working with Testsuites
- Within the testsuite I call a module "StartApp"
- I created a new class with a method which creates a new thread checking if the dialog appears and handling it.
- This method is called during "StartApp"
My Problem is now, how to "pause" the main thread if the Dialog is found, so I can handle the dialog without interrupting the testexecution. I searched but did not find a solution how to access the main thread.
Has someone an idea how to do this?
Thank you in advance
Best regards
Anja