04-14-2011, 01:44 PM
Hi Prodipto,
see if this is what you are looking for. I usually change the color of pass/fail actual result depending on the status. I am using undocumented Reporter.LogEvent.
see the snap attached for how it looks in the result viewer
let me know if this works for you.
see if this is what you are looking for. I usually change the color of pass/fail actual result depending on the status. I am using undocumented Reporter.LogEvent.
Code:
Function CustomResult(nStatus, sStep, sActual, sExpected)
Set oEventDesc = CreateObject("Scripting.Dictionary")
oEventDesc("ViewType") = "Sell.Explorer.2"
oEventDesc("Status") = nStatus
oEventDesc("EnableFilter") = False
oEventDesc("NodeName") = sStep
Dim sHTMLInfo
sHTMLInfo = "<TABLE border='0'>"
If nStatus = 1 Then
sHTMLInfo = sHTMLInfo & "<TR><TD><font color='red' size='2'>Actual Result: " & sActual & "</font></TD></TR>"
Else
sHTMLInfo = sHTMLInfo & "<TR><TD><font color='green' size='2'>Actual Result: " & sActual & "</font></TD></TR>"
End If
sHTMLInfo = sHTMLInfo & "<TR><TD><font color='blue' size='2'>Expected Result: " & sExpected & "</font></TD></TR></TABLE>"
oEventDesc("StepHtmlInfo") = sHTMLInfo
newEventContext = Reporter.LogEvent ("Replay",oEventDesc,Reporter.GetContext)
End Function
If 5 > 6 Then
CustomResult 1,"Check 5>6","5 is greater than 6", "5 should not be greater than 6"
Else
CustomResult 0,"Check 5>6","5 is not greater than 6", "5 should not be greater than 6"
End If
let me know if this works for you.