Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check color of a text box
#7
Solved: 11 Years, 4 Months ago
Hi All,

Please find the below LOC which will clear idea on how to work with the color and fonts.
(Copy and paste the code in QTP and Run)
-----------------------------------------------------------------------------------------
'Here is the simple piece of code to check the color,font,bgcolor,font-family.
Code:
Set wsh=CreateObject("WScript.Shell")
Dim lnkobj
If Browser("name:=Google").Page("title:=Google").Exist = False Then
    SystemUtil.Run "C:\Program Files\Internet Explorer\IExplore.exe","http://www.google.com/"
End If
Set lnkobj =Browser("name:=Google").Page("title:=Google").Link("name:=Hindi").Object.currentStyle
wsh.popup "Link BackGround Color ="& lnkobj.backgroundColor,2,"Link BackGround Color"
wsh.popup "Link font size ="& lnkobj.fontsize,2,"Link font size"
wsh.popup "Link font family ="& lnkobj.fontfamily,2,"Link font family"
wsh.popup "Link font color ="& lnkobj.color,2,"Link font color "
wsh.popup "Link text alignment ="& lnkobj.textalign,2,"Link text alignment "
Set lnkobj=Nothing
Browser("name:=Google").Close
--------------------------------------------------------------------------------------------

Please let me know if any one have any queries.
Thanks,
SUpputuri
Reply


Messages In This Thread
How to check color of a text box - by Pallavi - 09-27-2008, 02:18 PM
RE: How to check color of a text box - by Ankur - 09-27-2008, 07:43 PM
RE: How to check color of a text box - by Pallavi - 09-29-2008, 09:57 AM
RE: How to check color of a text box - by Ankur - 09-29-2008, 10:02 AM
RE: How to check color of a text box - by supputuri - 07-28-2009, 05:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems with Text color recognition Treirk 0 1,107 06-17-2019, 12:19 PM
Last Post: Treirk
  Getting background color of an object on mouse over Surya 2 3,890 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 6,024 06-06-2017, 11:12 AM
Last Post: workrohit08
  SwfTreeview - Color validation for child item YogeshCallappa 0 2,291 11-10-2016, 04:55 PM
Last Post: YogeshCallappa
  Need to Validate Text filed is blank after clicking on the Text box balak89 3 4,894 09-13-2015, 12:06 AM
Last Post: ADITI1992

Forum Jump:


Users browsing this thread: 3 Guest(s)