Debugging Automation Scripts
FintechOS offers several options for debugging automation scripts from the development and testing :environments:
Debugging Log
The Debugging Log adds information in the log file and continues the automation script execution.
If the script breaks due to a throwException or to an unexpected error, the log information will be written in the log file.
log("log 1");
log(newQuoteValabilityStartDate);
log("offer number" + '' +quote.Name);
log("test function"+birthDay +" "+ gender);
log("quote = " + serialize(quote));
Throw Exceptions
Break the automation script execution and display the message as specified within the throwException statement.
When the throwException method is called in an automation script, the passed error message is now available to users.
Examples of how throwException can be used for debugging purposes:
throwException(serialize("test"));
throwException(serialize(result.TotalNetProfit));
throwException(serialize(context));
throwException(String(Topic[0].a_Topic));
throwException(JSON.stringify(result));
throwException(JSON.parse(result));
JavaScript Exceptions
When parsing invalid Xml in automation scripts, JavaScript Exceptions are now caught by try catch
in JavaScript:
try
{
// load invalid XML
var doc = server.Xml.Load( '<a> ... <' );
}
catch(err)
{
// handle error
}
Console Debugging
Server-side errors are displayed within Developer Tools. During development and testing phases, engineers able to track errors raised on the server-side directly in the browser Developer Tools.
Browser developer tools to use for debugging automation scripts:
The error output displayed in the Console is particularly useful when raising issues. Include the error output in the issue description to provide a complete overview of the error and reduce the investigation time.