Hi Sasa,
You can implement the
OnLogError event handler (or
OnStopTest) where you can check whether errors were posted to TestLog during the test execution). If there were errors, save the test results to a file and open it from script. Here is how it may look like:
//JScript
function Main()
{
// Executing your test
}
function GeneralEvents_OnLogError(Sender, LogParams)
{
var ErrCount = Log.ErrCount;
if ( ErrCount > 0 )
{
Log.SaveResultsAs(<FileName>, lsMHT);
RunMHT(<FileName>);
}
else
Log.Message("There are no errors in the test log.");
}
function RunMHT(MHTpath)
{
var WshShellObj = new ActiveXObject("WScript.Shell");
var WshShellExecObj = WshShellObj.Run(MHTpath);
}