Clean up the result

Hi All,

Is there anyway or any function that I could use to clean up the script result before I execute it?

Any inputs and pointers are very appreciated.

Best Regards,

I’m not sure if you are asking to cleanup Eggplants results as stored in the Results directory of the Suite or if you are asking to clean up your SUT.

To remove results from Eggplant you can highlight the line in the Results tab and use the delete button (or hit the delete key).

Cleanup of the SUT can be scripted the same as any other interaction with the remote screen but other than this there is no inherent way to automatically “restore” or cleanup the remote system.

A common task is to write a cleanup script that will do some simple things like Cmd-Q to quit out of the application if it’s still running, delete any temporary files through the finder, etc.

You can then either run this as a standalone script, include it as an action to be called in an exception handler or call it as the last item from within a “Schedule” as constructed on the schedules tab in the Suite.

Thanks Jonathan,

I want to clean up the result in the result tab, not in SUT. Is there any function call to clean it up?

Best Regards,

There is not a SenseTalk function to do this directly.

If you are just looking to purge the results folder (but not remove them from the stored statistics). You can find the results folder by using the scriptResults() function and accessing the logFile property.

But trying to remove the results while they are being generating is likely to cause some unexpected behavior. So instead you should first call your script using the runWithNewResults command which will generate and save it’s results seperately. Conveniently that command returns that result’s property list. Here is an example that would run a script and purge it’s results folder.


put the result into lastResult

-- Delete The Results Directory, extracting it from the log file name
put lastResult.LogFile into logFolder
delete the last item delimited by "/" of logFolder
delete folder logFolder

-- Raise an Error if our sub script did not succeed
if (lastResult.status is not "Success") then throw "Script Failed"

Because running this script will itself generate results it will actually be very tricky to generate abolutely no results. If you run the above code as a selection you will notice that no results are generated.

For the future, we are looking at ways to provide users of Eggplant greater control over which results are generated.