Clean-up script

Could anyone explain the cleanup script , what it does? How to create it?and give example for this newbie (Seaweed).
Thank you very much.

Your scripts will need a standard starting condition from which to run – maybe your starting condition has the script running or maybe it has nothing running but the OS. The cleanup script is something that you write that returns the system-under-test to the starting condition. You can use a brute force cleanup script that “kills” the running process (using the “Force Quit” option on the Mac or “End Now” on Windows, for example), or you can do it more gracefully and have your script close all open windows and quit the app cleanly.

It’s not possible for Redstone to provide a generic cleanup script because we don’t know what your starting conditions will be or what windows/documents would be open that would have to be closed.

I hope this explanation helps.

I see this is an old post, is there an example out there of a cleanup script? Looking to start automating execution of my scripts but need to know that things get cleaned up if an error pops up.

I don’t think that there would be a good example of a generic cleanup script, because it depends on what your script was intended to do and what the point was when it failed. For example, I have a script that admits patients to a bed in each of our hospitals, performs some clinical documentation, and discharges the patient. My cleanup script checks to see whether any of my test patients are admitted and then discharges them.