I started using QARun just 1 1/2 months ago. I had no problem learning it. Now I got this quite interesting problem: How can I handle really unexpected errors so that I can continue - if possible - my script? Has somebody any god hint on that?
I mean if an error occures and it is not an forced error from my side I will not know if it is just a messagebox (with random buttons on it) or an SQL error with an child window...
I hope you can build you awnsers on that. Any ideas are welcome.
I just wondered if there is another (more clever) way than to put a whenever statement on to of the script for every different error, because how can I know that I really included all possible error if I haven't found them yet...
I had this problem too. You might have to do some digging to determine what errors you want to handle. If you don't have luck doing this, it might be something you modify each time you come up with a new error that you need to handle.
Also, another thing to think about with GUI's. Sometimes, programmers try and streamline their error routines. One way I noticed is that they may use different categories of error handling. For example:
- critical errors
- informational errors
- questions (simple yes/no - "do you want to save this doc?")
You could build your error handling on the above and use the capture/capture box function in QARun to log the type of errors that come up. This would reduce your code for error handling down to 3 types as opposed to coding for each error (whic is a lot of coding you would have to do.
I am also new at this, but this is what I do:
I take a picture of the error and save it.
then I close all open windows up to the runawl.
ret = ActiveName() ;
WinClose ; and close it
Then I open up the next script to run and start again.
I get all the information I can in the error handler size shape etc. and plus the picture. Then I can decide if I want to trap for that specific error the next time through, but at least all my scripts don't stop running.
This works pretty well. Unless you have to reboot.
[This message has been edited by Mark_N (edited 11-29-2001).]
I know its been a few years since this topic was active but I was doing some browsing and saw this and decided to explain an approach I used a few years ago.
I was testing a three tier system where the middleware would occassionally throw an error, which would appear in a popup, not directly related to what was happening at the user interface at the time. In other words these errors could occur at any time. To make things worse the developers had no documentation on all the possible errors in their code! Thanks Guys!
Our solution was to add a standard Whenever statement at the top of all our scripts that had a event of "Unexpected Window". Any window open triggers this event. The whenever statement transfered to a script that would determine if the new window was an error popup and capture the text displayed in it. The text was then used to search a datafile of errors and if found, an action from that file (abort, restart, continue) would be carried out after the popup was closed. If the error message wasn't found in the file, it was logged and added to the bottom of the error datafile for review later.
Using this method we were not only able to capture all the errors whenever they ocurred, but we also were able to build a very robust auto test suite which would continue with testing even after the errors happened.