I understand that Eggplant will automatically save the last seen screen if there is any error occurs during the run. It will be saved as Screen_Error.tiff under Results folder.
I’ve a script like this, whereby it should kill the tested application if it failed to run properly (execute the catch Exception block), follow by performing clean-up. I notice that the Screen_Error.tiff captured by Eggplant does not always reflect the last screen seen in the “try” block. But rather, most of the time, Eggplant captures the command-line prompt taken from the CleanUp function.
try (* Perform test steps here *) catch Exception (* Kill tested application before exit *) run KillApplication <application> (* Clean-up - this function works in command line mode, and it does not bring up any GUI *) run CleanUp (* Issue error messages before exit *) LogError "Failed to run update symbol or block test" LogError Exception.reason end try
I know that Eggplant has a function called CaptureScreen to let tester determines which screen and when to capture it. I guess the reason why Eggplant captures the wrong screen as the last seen screen could be due to timing problem? Is there any other way to control the timing when Eggplant captures the last seen screen in “try” block?