Forum Discussion
3 Replies
Sort By
- gmccordOccasional ContributorRight-Click the TestExecute icon in the task bar, Options-Engines-Log
Turn it off there. - patrick_lohmannNew ContributorIs there a possibility or a chance, to supress the opening of the log file only if there are no errors ? Or in other words, to open it just in the case, that there is any error in the log ?
- TanyaYatskovskaSmartBear 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 agoJonathanRoux
- 6 months agoAvinash12
Recent Discussions
- 2 days agoMW_Didata