Forum Discussion
bbi
9 years agoContributor
In addition to how to and if you use script test, be aware of error that can occurs on user disconnected with VM.
To manage theses errors you can use the general events onLogError to trap them.
Something like that (look at bold text):
/* --------------------------------------------------------------------------- Gestion des évènement log error --------------------------------------------------------------------------- */ function GeneralEvents_OnLogError(Sender, LogParams) { if (LogParams.MessageText == LASTERRORLOG) { SAMEERRORCOUNT++; LogParams.Locked = true; } else { // Pour éviter un test rouge // - sur une déconnexion de la VM // - ou sur une VM non visible var skip = aqObject.CompareProperty(LogParams.MessageText, cmpContains, 'is invisible', false, lmNone); if (!skip) { skip = aqObject.CompareProperty(LogParams.MessageText, cmpContains, 'because the user session is disconnected', false, lmNone); } if (skip) { Log.Message(LogParams.MessageText); LogParams.Locked = true; } else { // Transformer les erreurs d'objet inexistants en warning if ((IGNORENOTFOUND) && ((aqObject.CompareProperty(LogParams.MessageText, cmpContains, 'Unable to find the object', false, lmNone)) || (aqObject.CompareProperty(LogParams.MessageText, cmpContains, 'The object does not exist.', false, lmNone)))) { Log.Message(LogParams.MessageText, LogParams.AdditionalText, pmHigher, qa.system.logWarning); LogParams.Locked = true; } else { // Gérer les répétitions if (SAMEERRORCOUNT > 1) { Log.Message('Erreur "' + LASTERRORLOG + '" répétée ' + SAMEERRORCOUNT.toString() + ' fois !', '', pmNormal, qa.system.logInfo); } } LASTERRORLOG = LogParams.MessageText; Log.Message(LASTERRORLOG, LogParams.AdditionalText, pmHighest, qa.system.logError); SAMEERRORCOUNT = 0; LogParams.Locked = true; } } }
Related Content
- 8 years ago
- 10 years ago
- 12 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 6 days ago