ory_z
14 years agoContributor
LogParams changed behaviour on TC 8.5
Hi there,
I've noticed a change in the behaviour of the LogParams object in TC 8.5.
We use the OnLogError event to write the details of the error to an external text log. This is useful for when TC hangs or crashes (and the in built logs are lost) to help determine cause and at what stage of the test execution the failure happened.
My function looks something like this:
function GeneralEvents_OnLogError(Sender, LogParams)
{
var errorMessage
//Log error text & additional text to external log
errorMessage = LogParams.MessageText + "(" + LogParams.AdditionalText + ")"
WriteToExternalLog( "!!! ERROR - " + errorMessage )
}
This worked fine for TC8, 8.1 and 8.2. However in TC8.5 the LogParams.AdditionalText return a very padded string, for example:
<html><style>body {font-family : Courier New, Arial; font-size : 10pt; font-weight : normal; padding : 14px 8px 8px 14px; margin : 0 0 0 0;} p {margin : 4px 0 4px 0; padding : 0 0 0 0;} h4 {font-size: 10pt; font-weight : bold; margin : 12px 0 0 16px; padding : 0 0 0 0;} table {margin-left : 16px; border-top: 1px solid grey;} td {font-size : 10pt; font-weight : normal; padding-left : 8px;} </style><body><p>An error occurred while calling the "ClickButton" method or property of the "<a href="lnamemapping://{09E818B6-F3E0-4BED-B332-DB57AC0208CC}.{49DF2E34-97FE-4320-8A5E-6B759ED384C2}">PlayBtn</a>" object.<br/>The object or one of its parent objects does not exist.</p><h4>Tested Object</h4><table cellpadding="0" cellspacing="0" noborder><tbody><tr><td><b>Alias:</b></td><td>Aliases.RIOS_SSC32.InviteUnit.PlayBtn</td><tr><td><b>Mapping item:</b></td><td>NameMapping.Sys.RIOS_SSC32.InviteUnit.PlayBtn</td></tr></tbody></table><h4>Missing Object</h4><table><tbody><tr><td><b>Alias:</b></td><td>Aliases.RIOS_SSC32</td><tr><td><b>Mapping item:</b></td><td>NameMapping.Sys.RIOS_SSC32</td></tr></tbody></table><p style="margin-top: 12px;"><a href="aqa-help://2201">Possible causes of the error</a></p></body></html>
I've attached a screenshot of an inspection of the LogParams object.
Thanks,
Ory
I've noticed a change in the behaviour of the LogParams object in TC 8.5.
We use the OnLogError event to write the details of the error to an external text log. This is useful for when TC hangs or crashes (and the in built logs are lost) to help determine cause and at what stage of the test execution the failure happened.
My function looks something like this:
function GeneralEvents_OnLogError(Sender, LogParams)
{
var errorMessage
//Log error text & additional text to external log
errorMessage = LogParams.MessageText + "(" + LogParams.AdditionalText + ")"
WriteToExternalLog( "!!! ERROR - " + errorMessage )
}
This worked fine for TC8, 8.1 and 8.2. However in TC8.5 the LogParams.AdditionalText return a very padded string, for example:
<html><style>body {font-family : Courier New, Arial; font-size : 10pt; font-weight : normal; padding : 14px 8px 8px 14px; margin : 0 0 0 0;} p {margin : 4px 0 4px 0; padding : 0 0 0 0;} h4 {font-size: 10pt; font-weight : bold; margin : 12px 0 0 16px; padding : 0 0 0 0;} table {margin-left : 16px; border-top: 1px solid grey;} td {font-size : 10pt; font-weight : normal; padding-left : 8px;} </style><body><p>An error occurred while calling the "ClickButton" method or property of the "<a href="lnamemapping://{09E818B6-F3E0-4BED-B332-DB57AC0208CC}.{49DF2E34-97FE-4320-8A5E-6B759ED384C2}">PlayBtn</a>" object.<br/>The object or one of its parent objects does not exist.</p><h4>Tested Object</h4><table cellpadding="0" cellspacing="0" noborder><tbody><tr><td><b>Alias:</b></td><td>Aliases.RIOS_SSC32.InviteUnit.PlayBtn</td><tr><td><b>Mapping item:</b></td><td>NameMapping.Sys.RIOS_SSC32.InviteUnit.PlayBtn</td></tr></tbody></table><h4>Missing Object</h4><table><tbody><tr><td><b>Alias:</b></td><td>Aliases.RIOS_SSC32</td><tr><td><b>Mapping item:</b></td><td>NameMapping.Sys.RIOS_SSC32</td></tr></tbody></table><p style="margin-top: 12px;"><a href="aqa-help://2201">Possible causes of the error</a></p></body></html>
I've attached a screenshot of an inspection of the LogParams object.
Thanks,
Ory