Question on Results and Logging

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:

try
(*some test*)

catch e
   logerror "FAIL"
   (*code to clean up system*)
   (*code to prep for the next set of tests*)
end try

We have a handler (function) that places the app in a default state before each set of tests (each in a separate script):


run "DefaultState"

try
    run "Script1"
catch e
    //cleanup
end try

try
    run "Script2"
catch e
    //cleanup
end try

. . .


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.

Thanks!

Those are awesome ideas :lol:

Is there any option in the tool itself to create logs (for selection run) without creating new file or modifying the script yet?

What might you be looking for beyond what is in the Results folder?

Yes, I am just looking for log files (txt or xml) but it seems Eggplant is not generating these log files by creating a new folder under results folder if we just run a selection of script. It would be helpful in lot of cases to check on the results or generate our custom run reports.

There are two options here:

  • You can copy the data from the Output Pane in the scripting window or the Log Pane in the run window.

  • You can comment out those portions of a script outside your selection and run the script end-to-end.

Many customers do NOT want log files generated on the run of a selection so that logs from selection-only runs do not get mixed in with end-to-end runs.

You are also free to work through your TCSM to get a feature request created.

Hope this helps,
Dave