Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
changing the font color of text of object column in resultdetails page in test result
#6
Solved: 10 Years, 10 Months ago
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.

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
see the snap attached for how it looks in the result viewer

let me know if this works for you.


Attached Files Image(s)
   

Reply


Messages In This Thread
RE: changing the font color of text of object column in resultdetails page in test result - by Saket - 04-14-2011, 01:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems with Text color recognition Treirk 0 993 06-17-2019, 12:19 PM
Last Post: Treirk
  Getting background color of an object on mouse over Surya 2 3,736 06-27-2018, 08:51 PM
Last Post: vensas3181
  How can we get the Windows application Text box background color Using UFT 11.53 Kuppampattu 3 5,728 06-06-2017, 11:12 AM
Last Post: workrohit08
  SwfTreeview - Color validation for child item YogeshCallappa 0 2,108 11-10-2016, 04:55 PM
Last Post: YogeshCallappa
  Page element keep changing chong67 4 4,353 11-08-2016, 09:17 PM
Last Post: Paul Rammone

Forum Jump:


Users browsing this thread: 2 Guest(s)