how to handle user custom exceptions

Class library usage, coding and language questions.
Posts: 1
Joined: Mon Feb 15, 2010 10:59 am

how to handle user custom exceptions

Post by Apex30 » Mon Feb 15, 2010 11:06 am


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.

User avatar
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: how to handle user custom exceptions

Post by Ciege » Mon Feb 15, 2010 5:36 pm

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.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!