An event handler might work for you. You could search the BMC support site for "event handler" and also the TM ART Monitor Workbench online help. Here is one example:
Thanks Dan we actually leverage this code in our scripts, however we don't know how to pass a variable to the function, specifically a friendly name for the function, for instance:
sNiceStepName : string;
sNiceStepName := "click the login button";
BrowserClick("//INPUT[@value='LOGIN*']", BUTTON_Left, "Click, INPUT, name=/atg/userprofiling/ProfileFormHandler.login (#1)");
sNiceStepName := sNiceStepName + "-->click the find a location button";
BrowserClick("//A[@textContents='FIND A location*']", BUTTON_Left, "Click, A, textContents=FIND A location (#1)");
If either browser click returns false, then the value of sNiceStepName could/would be utilized in the error that is created
Not sure if the concat string logic is correct (var + new_string) but I think you get the point
Edit your script something like this (note, from memory without Workbench help handy)
if BrowserClick("//INPUT[@id='autoquote:e-mail']", BUTTON_Left)
continue with additional parts of script
Nest in additional tests as needed. This is the "cleanest" way to go. You can also cause the transaction to terminate via an appropriate RaiseError call. Check the help for details.
For this, just make "sNiceStepName" global by declaring it outside of your transaction definitions.
Yes, put "sNiceStepName" nearer to the top of your script, before dcltrans.