How can you test font size, type and color using QTP tool?

Answers were Sorted based on User's Feedback



How can you test font size, type and color using QTP tool?..

Answer / dharit shah

Set oWebElement = Browser("START").Page("START").WebElement
("ResizeText")
'Grabe the WebElement’s Runtime-Object’s CurrentStyle object
Set oStyle = oWebElement.Object.CurrentStyle
Msgbox oStyle.Color
Msgbox oStyle.fontWeight
Msgbox oStyle.fontStyle
Msgbox oStyle.fontSize

Is This Answer Correct ?    8 Yes 5 No

How can you test font size, type and color using QTP tool?..

Answer / poorna

I am getting the following error

General run error.
Line (2): "Set oStyle = oWebElement.Object.CurrentStyle".

Is This Answer Correct ?    2 Yes 0 No

How can you test font size, type and color using QTP tool?..

Answer / venu

Set oWebElement = Browser("START").Page("START").WebElement
("ResizeText")
'Grabe the WebElement’s Runtime-Object’s CurrentStyle object
Set oStyle = oWebElement.Object
Msgbox oStyle.currentStyle.color
Msgbox oStyle.currentStyle.fontWeight
Msgbox oStyle.currentStyle.fontStyle
Msgbox oStyle.currentStyle.fontSize

This should work I think!

-Venu

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More VB Script Interview Questions

Hi, Anybody could tell me What is the script for Reverse of Given number. Ex:236--632. Thanks in Advance..

10 Answers   Amazon, CSC,


Does VB/Win make standalone .EXE files?

0 Answers  


How will you get a random number between 0 and 1 in vbscript?

0 Answers  


What are the different types of operators and their order of precedence?

0 Answers  


HOW TO OPEN NEW TAB USING VB SCRIPT IN QTP?

1 Answers   TCS,






write a vb-script code to delete all the mails in my gmail in the year 2011

1 Answers  


what is the code in QTP to take screen shot? Please send me any one to my mail id. my mailid is manu.sanepalli@gmail.com

4 Answers   TCS,


Whenever I use Wscript.Echo Qtp raising Run time error as 'Object required for Wscript' How I can create object for Wscript

1 Answers  


what is descriptive programming in QTP and what is environment variable in QTP? where we store and what is its use?

4 Answers   Perot Systems,


Hai this is sheik, i want to learn VB scripts for web application pls guide me what are all basic things need to know to learn VB scripts in web application.

0 Answers  


Explain the functionality of vbscript?

0 Answers  


hi Set myobj=Description.Create() myobj("type").value="submit" myobj("name").value="google search" myobj("html tag").value="button" browser("title:=google").page("title:=google").webButton (myobj).Click i was running above code in one weak back it was working fine i got result,again i opened after few days ,again i was trying to run the code it shows run time error in last line of my code ,why ?pls answer my question?

0 Answers  


Categories