Forum Discussion
TanyaYatskovska
11 years agoSmartBear Alumni (Retired)
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);
}
Related Content
- 5 years ago
- 9 years ago
Recent Discussions
- 2 days ago
- 2 days ago
- 5 days ago