Page 1 of 1

how to handle user custom exceptions

Posted: Mon Feb 15, 2010 11:06 am
by Apex30
Hello,

Could you please help me with the following problem. I have an standalone windows application. I try to automate UI testing. The problem is that during the work in application the UI custom user exception can be raised in the floating window which is visible about 1-2 seconds and after that you can work in application as well. So, when I record the test script with this exception, the test is always pass! because I couldn't trace this exception.

Re: how to handle user custom exceptions

Posted: Mon Feb 15, 2010 5:36 pm
by Ciege
Well, if your AUT exception isn't Modal then you have to check for the exception continuously. Not the answer you were hoping for is it?...
Well, the most elegant solution I could come up with is to write some code to spawn a second thread whose job is to just check for exceptions. This way you do not have to continuously stop and check for exceptions in your main test code. If the second thread does catch an exception it will trigger the main thread to shut down and screenshot the desktop then close the log.