The software that I am automating is rather finicky and fails unexpectedly with regular unpredictable intervals. I have mitigated this by creating many, shorter scripts. We have just begun using the scripts officially and are working out the logging/results needs of our business. The issue I am having is that after an unexpected failure, I do not want to have to start the script completely over. Often they have run successfully for 45 minutes or an hour with only 20 minutes to go. I have found that when I “run selection” it does not create a log, which invalidates the second half of the testing.
Is there any way to create a result log using the ‘run selection’ feature?
The only other idea that I have come up with is to create even more, smaller scripts and just double test some items, but that is not preferred. Any ideas you have would be wonderful. I’m on version 3.21
You could try wrapping each group of tests in a try/catch block, and in your catch write code to get your app to the next place it needs to be to continue testing:
(*code to clean up system*)
(*code to prep for the next set of tests*)
We have a handler (function) that places the app in a default state before each set of tests (each in a separate script):
. . .
One quick-and-dirty solution for times when you just want to run “the rest of the script” is to copy the part you want into a new script and Run that script. That will generate a log file. Or you could temporarily comment-out the part that has already run, then re-run the same script.
For a better long-term solution you’ll pretty much need to split your script into more modules. Then either run the individual pieces inside try/catch blocks as Allen suggested, or in a master script that uses the RunWithNewResults command to run each piece and clean up afterward as needed to prepare for the next part.
Those are awesome ideas :lol: