Ryan_Petty
14 years agoNew Contributor
Error handling non-modal windows
I am new to Test Complete and am testing a .NET application. I do not have programming capabilities and I am trying to figure out how to catch exceptions in our .NET application. Many of our errors are non-modal. I am using checkpoints in Test Complete to check to see if an object exists or is visible to ensure the operation completed successfully.
However, sometimes part of an operation will complete and that object in the checkpoint will still exist, but an error message will also pop up in a small portion of the screen. It's non-modal so it doesn't prevent further actions from being performed on any part of the window except the small part that it overlaps. The problem is Test Complete says the test completed successfully. I want to be able to detect that exception window that pops up however and log it.
I have searched quite a bit through the forums and documentation and I see the On Overlapping Window event as well as the On Unexpected Error event. I have seen people ask if they can tell Test Complete what an unexpected window is and I couldn't see a clear answer to that. I have turned on to stop tests if the On Unexpected Error event occurs but our program's exception does not trigger that event. The On Overlapping Window event seems to only be called if a window pops up on the screen on top of a button or object to click, but our exception window is small and the odds that it will be over an area we are clicking is minimal.
I am no programmer, but I can reproduce the exception in our software and it does seem we have a standard exception window/object that pops up in our software that contains the actual error. It is a WinFormsObject called "ExceptionDialog". The actual error text within this object varies when the error comes up, but the "ExceptionDialog" seems standard.
So it's essentially the same object that I want to check to see if it pops up during a test and if it does, log some of the text properties of that object and log it as an error like Unexpected Window gets logged as. Sorry if there's a simple solution to this, but I could not find one. If it takes some coding, it's possible I can get some help from our developers soon, but would like to know my options.
However, sometimes part of an operation will complete and that object in the checkpoint will still exist, but an error message will also pop up in a small portion of the screen. It's non-modal so it doesn't prevent further actions from being performed on any part of the window except the small part that it overlaps. The problem is Test Complete says the test completed successfully. I want to be able to detect that exception window that pops up however and log it.
I have searched quite a bit through the forums and documentation and I see the On Overlapping Window event as well as the On Unexpected Error event. I have seen people ask if they can tell Test Complete what an unexpected window is and I couldn't see a clear answer to that. I have turned on to stop tests if the On Unexpected Error event occurs but our program's exception does not trigger that event. The On Overlapping Window event seems to only be called if a window pops up on the screen on top of a button or object to click, but our exception window is small and the odds that it will be over an area we are clicking is minimal.
I am no programmer, but I can reproduce the exception in our software and it does seem we have a standard exception window/object that pops up in our software that contains the actual error. It is a WinFormsObject called "ExceptionDialog". The actual error text within this object varies when the error comes up, but the "ExceptionDialog" seems standard.
So it's essentially the same object that I want to check to see if it pops up during a test and if it does, log some of the text properties of that object and log it as an error like Unexpected Window gets logged as. Sorry if there's a simple solution to this, but I could not find one. If it takes some coding, it's possible I can get some help from our developers soon, but would like to know my options.