Sei sulla pagina 1di 53

Re: how to invoke the web application through script in qtp Answer

1)Syntax:
system.util.run("path of the application")
this invokes any type of application.
2) 1).systemutil.run"path of the application"
.Invokeapplication"path of the application"
3) Systemutil.Run("iexplore")
Set vBrowser=Browser("Creationtime:=0")
vBrowser.navigate("Url of your application for example:
"gmail.com" ")

Description:

this is descriptive programming code, this code first will


open the "Internet Explorer" and then will put your given
"url" to the browser automatically.
4) create IEexplore object and pass the URL.
set Browser =createobject("InternetExplorer")
Browser.visible =True

!)systemutil.run("URL")
or
systemutil.run "iexplore.exe","URL"

!!) systemutil.run("iexplore")
set vbrowser=createobject("creationtome:=0")
vbrowser.navigate"URL"

4 ways to get & count objects in QTP

Imagine simple and practical QTP tasks:

• How to count all links on Web page?


• How to get them and click each link?
• How to get all WebEdits and check their values?

I'm going to show 4 approaches how to get lists of UI controls and process them (for example get
their count).
As an example, I will work with links on Google Labs page. My goal is to get the list of links and
count them.

I've added Google Labs page to my Object Repository and now it looks like:
I use
Object Repository (OR) to simplify my demo-scripts.
Since the browser & the page were added to OR, we can use them later like:
Browser("Google Labs").Page("Google Labs").

Now we are ready to start!

1. QTP Descriptive Programming (QTP DP) and ChildObjects QTP function


The approach uses Description object, which contains a 'mask' for objects we would like to
get.
QTP script is:

Set oDesc = Description.Create()


oDesc("micclass").Value = "Link"
Set Links = Browser("Google Labs").Page("Google Labs").ChildObjects(oDesc)
Msgbox "Total links: " & Links.Count

The result of this QTP script is:

Child
Objects returns the collection of child objects matched the description ("micclass" is
"Link") and contained within the object (Page("Google Labs")).

2. Object QTP property and objects collections


QTP can work with DOM:

Set Links = Browser("Google Labs").Page("Google Labs").Object.Links


Msgbox "Total links: " & Links.Length
I use Object property of Page object. It represents the HTML document in a given browser
window.
This document contains different collections - forms, frames, images, links, etc.
And we use Length property to get the number of items in a collection.

The result is the same as for the previous QTP script:

3. Object QTP property and GetElementsByTagName method


Again, we can get access to the HTML document and use its GetElementsByTagName
method.
As the name says, GetElementsByTagName method returns a collection of objects with
the specified tag.
Since we are going to get all link, we should use "a" tag.

QTP script is:

Set Links = Browser("Google Labs").Page("Google


Labs").Object.GetElementsByTagName("a")
Msgbox "Total links: " & Links.Length

The result is the following:

Note: There is another way how to select objects by tag name:

Set Links = Browser("Google Labs").Page("Google Labs").Object.all.tags("a")


Msgbox "Total links: " & Links.Length

The result will be the same. 69 link will be found.

4. XPath queries in QTP


The idea of this approach is to use XPath queries on a source code of Web page.
For example, "//a" XPath query returns all "a" nodes (= links) from XML file.

There is one problem. Web page contains HTML code, which looks like XML code but
actually it is not.
For example:
o HTML code can contain unclosed img or br tags, XML code cannot.
o HTML code is a case-insensitive markup language, XML is a case-sensitive
markup language, etc
More details here.
So, we have to convert HTML source code into XML. The converted code is named as
XHTML.

You can convert HTML documents into XHTML using an Open Source HTML Tidy
utility.
You can find more info about how to convert HTML code into XHTML code here.

I will use the final QTP script from this page, a bit modified:

' to get an HTML source code of Web page


HtmlCode = Browser("Google Labs").Page("Google
Labs").Object.documentElement.outerHtml

' save HTML code to a local file


Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateTextFile("C:\HtmlCode.html", True, -1)
f.Write(HtmlCode)
f.Close()

' run tidy.exe to convert HTML to XHTML


Set oShell = CreateObject("Wscript.shell")
oShell.Run "C:\tidy.exe --doctype omit -asxhtml -m -n C:\HtmlCode.html", 1, True '
waits for tidy.exe to be finished

' create MSXML parser


Set objXML = CreateObject("MSXML2.DOMDocument.3.0")
objXML.Async = False
objXML.Load("C:\HtmlCode.html")

XPath = "//a" ' XPath query means to find all links


Set Links = objXML.SelectNodes(XPath)
Msgbox "Total links: " & Links.Length

Note: you can download tidy.exe here for above QTP script.

This QTP script leads to the same results - 69 links found:

(Click the image to enlarge it)


5. Bonus approah
Why don't you count all Wen page objects manually? :) Open a source code of the page
and start counting :)
Just joking :)

Summary:

• I shown 4 practical approaches how to count Web page links.


Similarly you can process images, webedits, etc
• Each approach gets a list of objects.
• First approach (QTP DP + ChildObjects) is the most easy
• Second & third approaches (Object + collections; Object + GetElementsByTagName)
will work on Internet Explorer, because they use DOM methods
• Fours approach is biggest but it is more powerful. It allows to use complex XPath queries.

Related articles:

• XML file reading from QTP


• How to update XML file from QTP
• All QTP visual tutorials

QTP Hackers - How to decrypt encrypted (SetSecure'd) password

I will explain you how to decode an encoded password in QTP.


Using QuickTest Professional and this approach, you can hack email accounts published on
Internet. Are you interested? :) So, continue reading this QTP tutorial for details.
I've just recorded a simple script, which signs into Gmail. It:

1. Fills 'Username' in
2. Fills 'Password' in
3. Clicks 'Sign in' button

And the recorded QTP script is:


Browser("Gmail").Page("Gmail").WebEdit("Email").Set "someaccount"
Browser("Gmail").Page("Gmail").WebEdit("Passwd").SetSecure
"493844a99bee0e3ab952f2e867fd08e3"
Browser("Gmail").Page("Gmail").WebButton("Sign in").Click

As you can see, QTP script is simple enough.


I've set "someaccount" to 'Username' editbox. But what about 'Password' editbox? What value
have I filled in?

QTP encrypted the password using SetSecure method:


WebEdit("Passwd").SetSecure "493844a99bee0e3ab952f2e867fd08e3"
QTP Help:
The SetSecure method is recorded when a password or other secure text is entered.
The text is encrypted while recording and decrypted during the test run.

How to know the initial text?

There is one trick. Apply SetSecure method to non-secured edit box!


Instead of this QTP code:
Browser("Gmail").Page("Gmail").WebEdit("Email").Set "someaccount"
Browser("Gmail").Page("Gmail").WebEdit("Passwd").SetSecure
"493844a99bee0e3ab952f2e867fd08e3"
I run this QTP script:
Browser("Gmail").Page("Gmail").WebEdit("Email").SetSecure
"493844a99bee0e3ab952f2e867fd08e3"
And the result of this QTP script is:

Yes, "mypwd" was encrypted to


"493844a99bee0e3ab952f2e867fd08e3". So, "mypwd" is the password I filled!
So, this is an easy way to decrypt an encrypted password in QTP.

By the way, there are two ways how to decrypt a password in QuickTest Professional:

1. Using Crypt.Encrypt

str = "Some Text"


encrStr = Crypt.Encrypt(str)

'encrStr' will contain an encrypted text.


2. Using Password Encoder from 'Start/Programs/QuickTest Professional/Tools'

Summary:

• I explained two ways how to crypt a text in QTP


• I shown an approach how to decrypt an encrypted text
• .
You will learn different QTP DataTable concepts:

• How to create QTP DataTable parameter using QTP Data Driver


• How to create QTP DataTable parameter manually
• How to read/write values from/to QTP DataTable
• QTP script and DataTable execution settings
• Global and local (action) sheets of DataTable
• QuickTest Professional data-driven tests

There are two ways how to get all properties of an object in QuickTest Professional:

1. Manually
2. Programmatically

Use QTP Object Spy to get manually object properties.


I've captured properties of ''Advanced Search" link from Google's page:

So, QTP Object Spy


shows these values:
Using QTP Object Spy you can get Run-time
Object Properties and Test Object Properties.
It's possible to get these properties programatically:

• The GetTOProperty and GetTOProperties methods enable you to retrieve a specific


property value or all the properties and values that QuickTest uses to identify an object.
• The GetROProperty returns the current value of the test object property from the object in
the application.

GetTOProperty differs from the GetROProperty method:

• GetTOProperty returns the value from the test object's description.


Test Object Properties are stored in the QTP Object Repository.
• GetROProperty returns the current property value of the object in the application during
the test run.
QTP reads Run-time Object Properties from actual objects during the runnins can be read
and accessed during the run session.
That means that when you work with objects using QTP Descriptive Programming (DP),
you will be able to access run-time object properties only (using GetROProperty
function). Test object properties (using GetTOProperty function) will not be accessed,
because QTP DP doesn't work Object Repository.

There is a problem with Run-time object properties.


In contrast to GetTOProperties (which returns the collection of all properties and values
used to identify the test object), GetROProperties function does NOT exist!
Once again - GetROProperties function does NOT exist!

Well, how to get all Object Indentification Properties of an object?


Answer: We can read them from Windows Registry.

The following registry key contains properties of a given test object:


HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\QuickTest
Professional\MicTest\Test Objects\_Test_Object_\Properties

For example, I've opened:


HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\QuickTest
Professional\MicTest\Test Objects\Link\Properties and I've got properties of Link
object:

Please note that you can find the same Link Identification Properties in QuickTest
Professional Help:
QTP Object Identification Properties can be used:

• in the object repository description


• in programmatic descriptions
• in checkpoint and output value steps
• and as argument values for the GetTOProperty and GetROProperty methods
So we have to read all Identification Properties from the registry.
This QTP code reads Link Identification Properties:

Const HKEY_LOCAL_MACHINE = &H80000002


Set oReg = GetObject("winmgmts:
{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

sKeyPath = "SOFTWARE\Mercury Interactive\QuickTest Professional\MicTest\Test


Objects\Link\Properties"
oReg.EnumValues HKEY_LOCAL_MACHINE, sKeyPath, arrNames

As a result, arrNames array contains all names of properties.


To prove my words I use this QTP script:
sNames = "Identfication Properties:" & vbNewLine

For i = 0 to UBound(arrNames)
sNames = sNames & arrNames(i) & vbNewLine
Next

MsgBox sNames
The result is:

Compare these Link Identification Properties with properties from the


registry. They are the same!

So, we can read names of properties.

Next step is to read their values. It can be archived using GetTOProperty or GetROProperty.
Also, I'm going to show how GetTOProperty and GetROProperty work for Test Object
(located in QTP Object Repository) and Run-time Object (actual object, created during the run
session).

1. Properties of Test Object


QTP script is:

' Link("Advanced Search") is an object from QTP Object Repository


Set TestLink = Browser("Google").Page("Google").Link("Advanced Search")

sNamesTO = "GetTOProperty for Test Object" & vbNewLine & "Identfication


Properties: Values" & vbNewLine
sNamesRO = "GetROProperty for Test Object" & vbNewLine & "Identfication
Properties: Values" & vbNewLine

For i = 0 to UBound(arrNames)
sNamesTO = sNamesTO & arrNames(i) & ": " &
TestLink.GetTOProperty(arrNames(i)) & vbNewLine
sNamesRO = sNamesRO & arrNames(i) & ": " &
TestLink.GetROProperty(arrNames(i)) & vbNewLine
Next

MsgBox sNamesTO
MsgBox sNamesRO
o Test Object Properties of Test Object
Test Object Properties of Test Object and their values are:

o Run-time Object Properties of Test Object


Run-time Object Properties of Test Object and their values are:

2. Properties of Run-time Object


QTP script is:

' Link("text:=Advanced Search") is a dynamic run-time object


Set TestLink = Browser("Google").Page("Google").Link("text:=Advanced Search")

sNamesTO = "GetTOProperty for Run-time Object" & vbNewLine & "Identfication


Properties: Values" & vbNewLine
sNamesRO = "GetROProperty for Run-time Object" & vbNewLine & "Identfication
Properties: Values" & vbNewLine

For i = 0 to UBound(arrNames)
sNamesTO = sNamesTO & arrNames(i) & ": " &
TestLink.GetTOProperty(arrNames(i)) & vbNewLine
sNamesRO = sNamesRO & arrNames(i) & ": " &
TestLink.GetROProperty(arrNames(i)) & vbNewLine
Next

MsgBox sNamesTO
MsgBox sNamesRO

o Test Object Properties of Run-time Object


Test Object Properties of Run-time Object and their values are:

Why almost all properties are empty?

As I said, GetTOProperty function gets values from Test Object, which is stored
in QTP Object Repository. Since Run-time Object is a dynamic object, it's not
stored in QTP Object Repository. That's why GetTOProperty function cannot read
object's properties.

Look at the above screenshot again. The only one property ('text') contains its value
('Advanced Search'). We used this property to create description for our link:

Set TestLink = Browser("Google").Page("Google").Link("text:=Advanced


Search")

That's why this Run-time Object contains the only property.

o Run-time Object Properties of Run-time Object


Run-time Object Properties of Run-time Object and their values are:
As you can see, we got
the same Run-time Object Properties both for Test Object and for Run-time Object.
I can explain it.
During the run session, QTP creates a Run-time copy of Test Object. That's why
Run-time Object Properties were the same for Test Object and Run-time Object.

How to update XML file from QTP

In previous QTP tutorial I shown how QTP can read data from XML file.
Today I will explain how to update XML data from QTP.

We will use this XML file:

Note: You
can download this XML file here.

Let's check how to update different values in above XML file:


1. How to rename the title of first book?
The QTP script is:

Const XMLDataFile = "C:\TestData.xml"


Const XMLNewFile = "C:\TestData2.xml"

Set xmlDoc = CreateObject("Microsoft.XMLDOM")


xmlDoc.Async = False
xmlDoc.Load(XMLDataFile)

' update the title of the first book


Set node = xmlDoc.SelectSingleNode("/bookstore/book[0]/title")
node.Text = "Romeo and Juliet - Salvation"

' save changes


xmlDoc.Save(XMLNewFile)

And the result is:

Note: The numeration begins from zero. That's why I use book[0] to access first item.

2. How to change the year of second book?


I skip the opening and saving of XML file (see above QTP script). I show only the essence:

' update the attribute of the second book


Set node = xmlDoc.SelectSingleNode("/bookstore/book[1]/title/@published")
node.Text = "2009"

And the result is:

Note: Use @
to access an attribute of XML node.

3. How to add new author add its new attribute?


QTP script:

' select a parent node


Set parentNode = xmlDoc.SelectSingleNode("/bookstore/book[2]")

' add a new author


Set newNode = xmlDoc.CreateElement("author")
newNode.Text = "Mr. Noname"
parentNode.AppendChild (newNode)
And the result is:

As you can
see, we've added "Mr. Noname" as the new author.

4. How to add new attribute for author (XML node)?


QTP script:

' select a parent node


Set parentNode = xmlDoc.SelectSingleNode("/bookstore/book[2]")

' add its attribute


Set newAttrib = xmlDoc.CreateAttribute("bestseller")
newAttrib.Text = "yes"
parentNode.Attributes.SetNamedItem(newAttrib)

The result is:

New
attribute of a boof and its value ("bestseller"="yes") have been added.

Well, the working with XML files from QTP is easy enough.

Summary:

• shown in QTP - how to change value of XML node


• shown in QTP - how to change value of attribute
• shown in QTP - how to add new XML node
• shown in QTP - how to add new attribute

QTP - How to rename Excel worksheet

The present QTP tutorial shows simple recipe how to rename Excel worksheet from QuickTest
Professional.
For example, Excel-file contains 'Sheet1' sheet:

How to rename Excel worksheet from VBScript and QTP?

Use the following QTP script, which perform the work using Excel's COM object -
"Excel.Application":
Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True
objExcel.DisplayAlerts = False

Set objWorkbook = objExcel.Workbooks.Open ("c:\Book1.xls")


Set objWorksheet = objWorkbook.Worksheets(1)

objWorksheet.Name = "VBScript_Excel"
objWorkbook.SaveAs ("c:\Book1.xls")
objExcel.Quit

The above QTP script renames Excel worksheet:

Summary:

• Excel's COM object ("Excel.Application") allows performing operations on Excel


application
• The present visual tutorial explains how to rename Excel sheet from QTP
QTP RegExp VIDEO - How to click dynamic link?

The present QTP video explains how to click dynamic links, which change their text.
For example, the number of email drafts can vary:

QuickTest Professional cannot know in advance which text will be present.

So, how QTP can click such dynamic links?


There are several possible solutions:

1. We can use QTP Regular Expression to match dynamic link.


2. We can use QTP DP (Descriptive Programming) in to find the link during run-time.
3. We can use others properties of the dynamic link to identify it
4. The present QTP video shows first approach.
The tutorial covers the following:

• working with QTP Object Repository


• identification properties of QTP objects
• QTP RegExp in object's properties
• how QTP identifies objects in application
• and others...

QTP RegExp VIDEO - How to click dynamic link?

QTP Descriptive Programming - How to perform operations on objects?

In previous QTP tutorial (QTP Descriptive Programming - How to get number of objects) I
explained how to get number of objects (Edits, Links, Buttons) with QTP Descriptive
Programming (QTP DP).
Today I'm going to show:
How to use QTP DP to perform different operations on objects.

For example, how to type text in these edit boxes on Google Sets page:
From previous QTP DP tutorial you know that this code returns a collection of Edits located on
Web page:
Set Desc = Description.Create()
Desc("micClass").Value = "WebEdit"
Set Edits = Browser("Google Sets").Page("Google Sets").ChildObjects(Desc)

So, to type text in each Edit, we have to process edit boxes from returned collection one by one.
We can access the specified item from a collection by item's index.

For example, the following code types a text in the first edit box:
Edits(0).Set("Text in Edit #1")
And its result is:

Note:
ChildObjects returns zero-based collection of found objects.
That's why use Edits(0) to access first item, Edits(1) to access second item, and so on.

So, we add a loop to process all edit boxes on a page.


The final QTP script is:
Set Desc = Description.Create()
Desc("micClass").Value = "WebEdit"
Set Edits = Browser("Google Sets").Page("Google Sets").ChildObjects(Desc)

NumberOfItems = Edits.Count
For i = 0 To NumberOfItems - 1
Edits(i).Set("Text in Edit #" & (i+1))
Next

This code fills all Edits in. So, the result page looks like:
As you
can see - QuickTest Professional Descriptive Programming works correctly.

Note: If the initial page contains more (i.e. 8) or less (i.e. 3) number of edit boxes, our QTP script
will work without changes!
Note: Since we do not use QTP Object Repository (QTP OR), this approach can be integrated
easily into any existing QTP system. Shared Object Repository is not required!
Summary:
The article shows how to perform operations on objects.
The approach uses QuickTest Professional Descriptive Programming.

QTP Descriptive Programming - How to get number of objects

I'm going to explain and show QTP Descriptive Programming (DP) through Google Sets site:
(click image to enlarge it)

The goal of the present QTP tutorial is to describe:


How to get number of controls (Links, Edits, Images, etc) with QTP DP.

Let's investigate Descriptive Programming on examples.


First of all, we should understand what Descriptive Programming means:
What is QuickTest Professional Descriptive Programming (QTP DP)?

Answer: QTP DP is a run-time processing of objects which are not located in QTP Object
Repository.

I've created new QTP script which starts with http://labs.google.com/sets page.
This QTP script is simple enough:
Set Desc = Description.Create()
Desc("micclass").Value = "WebEdit"
Set Edits = Browser("Google Sets").Page("Google Sets").ChildObjects(Desc)

MsgBox "Number of Edits: " & Edits.Count


And its result is:

As you can see, it works correctly and returns correct number of Edits on a page.
I'm going to explain this QTP script and answer the following question:

How does QTP Descriptive Programming work?

First of all, I've created new Description object:


Set Desc = Description.Create()
Description object contains collection of properties, which identify any UI object such as a
browser, a page, a dialog, a list, a button etc.

To specify that we want identify all Edits on browser's page I use "micclass" property:
Desc("micclass").Value = "WebEdit"
Note: the "mic" prefix in "micclass" stands for "Mercury Interactive Constant".

How do you know the class name ("micclass") of object?

Use Spy for that:

Open QTP object Spy and check recorded properties of object.


For example, these are properties of Edit:
As you can see, there is "Class Name" property and its value - "WebEdit". So, "WebEdit" is a
value of Class Name of all Edits located on Web page.
Note: "Class Name" is a synonym of "micclass".

I gathered Class Names of Web objects in this table:


# Type of Web object Class Name(micclass)
1 Web Browser Browser
2 Page Page
3 Edit box WebEdit
4 Image Image
5 Link Link
6 Web Element WebElement
7 Button WebButton
8 Checkbox WebCheckBox
9 Combobox (DropDownList) WebList
10 Table WebTable

Since we created Description object for all edit boxes, we can use this description to get all
specified objects ( = edit boxes).
The next step returns the collection of all child objects (i.e. edit boxes) contained within the page:
Set Links = Browser("Google Sets").Page("Google Sets").ChildObjects(Desc)

To get the number of found objects in a returned collection, we use Count property:
MsgBox "Number of Edits: " & Links.Count

And the result is 5 found Edits on Google Sets page:

So, this is a mechanism of QuickTest Professional Descriptive Programming.

Also, we can use the same code to get number of others objects - Links, Images, Buttons, etc.
For that I modified QTP script:
Function GetAllSpecificControls(Page, MicClass)
Set Desc = Description.Create()
Desc("micclass").Value = MicClass
Set GetAllSpecificControls = Page.ChildObjects(Desc)
End Function

Function GetAllEdits(Page)
Set GetAllEdits = GetAllSpecificControls(Page, "WebEdit")
End Function

Function GetAllButtons(Page)
Set GetAllButtons = GetAllSpecificControls(Page, "WebButton")
End Function

Function GetAllLinks(Page)
Set GetAllLinks = GetAllSpecificControls(Page, "Link")
End Function

Function GetAllImages(Page)
Set GetAllImages = GetAllSpecificControls(Page, "Image")
End Function

Set oPage = Browser("Google Sets").Page("Google Sets")

MsgBox "Number of Edits: " & GetAllEdits(oPage).Count


MsgBox "Number of Buttons: " & GetAllButtons(oPage).Count
MsgBox "Number of Links: " & GetAllLinks(oPage).Count
MsgBox "Number of Images: " & GetAllImages(oPage).Count
The result of this QTP script is the following:

You can compare the result with the initial web page (see first image in the present article) and
verify that QTP Descriptive programming works correctly - it returns correct numbers of objects.

Summary:
• I've explained and shown the mechanism of QuickTest Professional Descriptive
Programming (QTP DP).
• The present QTP tutorial explains how to get number of different objects - Edits, Links,
Images, Buttons, etc.

How to get current iteration number of QTP script?

QTP test can run several iterations.


By default, when you run a test with global QTP Data Table parameters, QuickTest runs the test
for each row in the Data Table, using the parameters you specified.

For example, the following global QTP Data Table contains 3 rows:

The iteration number of QTP test can be specified in 'File/Settings.../Test Settings dialog', 'Run'
tab:

If we run our QTP test with above settings (global DataTable & 'Run' tab), the test will pass 3
iteration.
So, the question is How to determine the current iteration number withing QTP script?
Answer: We can use the value of "TestIteration" environment variable -
Environment("TestIteration").

This is a sample QTP script I use to demonstrate Environment("TestIteration"):


str = "Current QTP iteration: " & Environment("TestIteration") & vbNewLine & _
"Param1: " & DataTable("Param1", dtGlobalSheet) & vbNewLine & _
"Param2: " & DataTable("Param2", dtGlobalSheet)

MsgBox str
And the result of above QTP script is:

As you can see, QuickTest Professional script works correctly.


You can use this approach to determine the current iteration number of running QTP script

ow to get text of Status Bar from QTP?

When you work in QTP with Web applications, it is sometimes necessary to get a text of
browser's status bar.
Let's see for example the following browser:

How to get text of Status Bar from QuickTest Professional?


There are two ways:

1. Object.StatusText property of Browser object


2. GetROProperty("text") method of WinStatusBar object

1. Getting text of Status Bar using Object.StatusText property of Browser object

To access text of Status Bar, we use Browser's Object object and its StatusText property.
Browser("bname").Object is a reference to the Internet Explorer's DOM object. To be more
precise, it's a reference to the Internet Explorer's IWebBrowser2 interface.

Using Browser("bname").Object, you can access different methods and properties of IE, for
example:
# Statement Meaning
1 Browser("bname").Object.GoBack Navigates backward one item in the history list
2 Browser("bname").Object.LocationURL Gets the URL of the page that is currently
displayed
3 Browser("bname").Object.StatusText Sets or gets the text in the status bar for the
object
4 Browser("bname").Object.ToolBar Sets or gets whether toolbars for the object are
visible
2.
So, our code is simpe enough:
3. sText = Browser("QTP - How to get Status").Object.StatusText
MsgBox sText
4. And its result is:

5.
6. Note: Since we use Internet Explorer's IWebBrowser2 interface, we can use this solution
win IE only. It doesn't work with FireFox. The next solution will be compatibe with both
IE and FF.

7. Getting text of Status Bar using GetROProperty("text") method of WinStatusBar


object

Status bar is a part of browser's window. There is a special class to handle it from QTP -
WinStatusBar. We can get text of WinStatusBar using GetROProperty("text") method.

So, I add Status Bar to QTP's Object Repository (OR):


The final script is:

sText = Browser("QTP - How to get


Status").WinStatusBar("msctls_statusbar32").GetROProperty("text")
MsgBox sText

And its result is:

Note: This solution works correctly both for IE and FF, but it requires additional operations
with Object Repository.

QTP - quotes in VBScript


Today I found an interesting question on Ankur Jain's blog.
The question was simple - how to display quotation marks (") in QTP?

There two ways to do that:

1. Double the quotes (""):

MsgBox "#1: ""QTP - QuickTest Professional"""

Use 2 double quotation marks to include a quote character in the string.


So, the result is:

2. Use ANSI character code - Chr(34):

MsgBox "#2: " & Chr(34) & "QTP - QuickTest Professional" & Chr(34)

Since, the ANSI code if quotation mark = 34, we can use Chr function.
The result is:
QTP Descriptive Programming - How to close all Browsers?

This is a very practical task - How to close all browsers from QTP?
You may need to close browsers before or during the QTP script execution.

You can be surprised, but QTP script, that closes all browsers, will contain 3 lines only:

Well, how does this code work?

To answer, I have to tell about QuickTest Professional Descriptive Programming.


Descriptive Programming (DP) is a working with object, which are not described in QTP Object
Repository (OR).
All objects properties are calculated dynamically during the QTP test execution.

Please, check this code:


While Browser("CreationTime:=0").Exist
Browser("CreationTime:=0").Close
Wend
"CreationTime" is a QTP browser property, which indicates the order in which browsers were
opened.

QTP Tip1: The first browser that opens receives the value "CreationTime" = 0, the second
browser receives "CreationTime" = 1, and so on...

QTP Tip2: To specify value of property in Descriptive Programming, please use ":=" operator.
For example, "Title:=My application".

Since we cannot know in advance - what browser will be selected and closed, we use its "age", i.e.
"CreationTime" property. We decide, which browser should be closed, during the QTP script
execution only.

Let's return to above QTP script...

• Browser("CreationTime:=0").Exist - it checks whether the first opened browser exists or


not
• If the browser exists, we close it - Browser("CreationTime:=0").Close - and repeat
checking
Let's continue сomplicating our task:

How to close browsers by mask?

For example, we have to close all browsers navigated to any Google's sites (URL contains
'google.com').

In this case, QTP script will look like:

(Click the image to enlarge it)

Using this QTP code, you can close dynamically browsers by mask.

Please, note several useful QTP tips.


QTP Tip3: To get browser's URL, use: GetROProperty("URL") function.
For example, this line returns URL of the first opened browser:
Browser("CreationTime:=" & CreationTime).GetROProperty("URL")
QTP Tip2: Analogously, to get browser's Title, use: GetROProperty("Title") function.
Browser("CreationTime:=" & CreationTime).GetROProperty("Title")

Summary:
I've shown and explained:

• Simple concepts of QTP Descriptive Programming


• How to close all browsers from QTP test
• How to close browsers by mask from QTP test

QTP - getting current browser URL

I'm going to show and explain how to get current URL which is opened in a browser.
For example, how to get URL "http://motevich.blogspot.com" from the following browser:

There are two solutions:

1. Using GetROProperty("URL") method (run-time object property)


2. Using "URL" property of "Object" (IE DOM Object)

Let's consider both variants.

1. GetRoProperty("URL") method (run-time object property)

GetRoProperty function reads properties of a run-time object in an application.


If you open QTP Help on GetRoProperty function, you 'll see that this function can work
with all objects:

So, for example:


o to check whether a link is visible or not, use:
Browser("bname").Page("pname").Link("lname").GetROProperty("visible")
o to get a page's title, use:
Browser("bname").Page("pname").GetROProperty("title")
o to check whether a window is maximized, use:
Window("wname").GetROProperty("maximized")
o to get width of WebButton, use:
Browser("bname").Page("pname").WebButton("btname").GetROProperty("width
")

Others properties are described in QTP Help.

In our case, to get URL of the current WebPage, we will use:

Browser("bname").Page("pname").GetRoProperty("URL")

This is a sample QTP script:

(Click the image to enlarge


it)

2. "URL" property of "Object" (IE DOM Object)

The sample syntax is:

Browser("bname").Page("pname").Object.URL

What is "Object" in the above statement?

Actually, this is Internet Explorer Document Object Model (DOM) Object.


You can read more about DOM here and here.
Also, I recommend to read this interested article on working with IE DOM from Visual
Basic.

Tip: You can use DOM Object when running QTP test on Internet Explorer only!

To make the long story short, I can say that using Object property you can get almost all
elements and properties from Web page.

Thus, I use URL property of Internet Explorer's DOM Object.


All properties, collections, and methods of DOM Object are described in this MSDN
article.

Tip: The number of properties, accessed via DOM Object, is more bigger, than properties
accessed via GetROProperty method.
So, the result of above code is:

(Click the image to enlargit)

Summary:
Two ways were discussed:

1. GetROProperty("URL") (run-time object property)


2. "URL" property of "Object" (IE DOM Object)

GetROProperty method supports both IE & FireFox, but IE DOM Object provides more
accessible properties and methods.
Both can get URL of the current Web page.

QTP - Capturing tool tips of images

In my previous post (QTP - How to capture tool tip?) I shown an example on capturing tool tip of
Web page link.
That solution uses FireEvent("onmouseover") and GetROProperty("text") to get tool tip of a
link.

Now, I'm going to show how to show how to capture tool tips of images located on a Web page.

Actually, the solution is simple.


To capture a tool tip of an image, we can get value of "alt" Run-time Object property with
GetROProperty("alt") function:
Browser("brw").Page("pg").GetROProperty("alt")

Let's verify this code in practice. For example, let's check tooltips from Wikipedia Main page:
I've prepared QTP script, which gets all image from this page and checks their tooltips ("alt"
property):
Dim descImage, listImages, attrAltText, attrSrcText

Browser("Main Page - Wikipedia,").Sync


Browser("Main Page - Wikipedia,").Page("Main Page -
Wikipedia,").Sync

' Create description for all images on a Web page.


' For that we use "html tag" property and its value "IMG"
Set descImage = Description.Create
descImage("html tag").value = "IMG"

' Get all images which match the above description


Set listImages = Browser("Main Page - Wikipedia,").Page("Main Page
- Wikipedia,").ChildObjects(descImage)

' Check tool tips of images


For i = 0 To listImages.Count - 1
attrAltText = listImages(i).GetROProperty("alt")
attrSrcText = listImages(i).GetROProperty("src")

If attrAltText <> "" Then


MsgBox "Image src: " & attrSrcText & vbNewLine & "Tool
tip: " & attrAltText
End If
Next

When I run this code in QTP, it shows all images containing non-empty tool tip:
(click the image to enlarge it)

The same message boxes will be shown for others images on a Web page.
So, our solution is simple - use GetROProperty("alt") function to get tool tip of image.
As you can see - it works correctly.

QTP Descriptive programming - processing images

Imagine a practical situation with QuickTest Professional (QTP).


There are several images on a web page. You need to:

• get the number of all images on the page


• process each image (for example, get its location)

Do you know how to do that? If not, do not sorrow :) I'm going to show and explain how to do
that.
Also, I'm going to explain QTP Descriptive Programming concepts.
Let's start with Google Book Search page:

I have recorded simple QTP script which:

1. uses http://books.google.com as initial URL


2. clicks 'Google Book Search' image:

So, the recorded QTP script is:


Browser("Google Book Search").Page("Google Book Search").Image("Google Book
Search").Click

Why have I recorded this script?


Because it will help us to investigate QTP Object Repository (OR) and properties of image.
Let's open Object Repository:

And then we check image's properties


saved in Object Repository:

(click the image to enlarge it)

Using "html tag" property and its value "IMG", we can create general description for all images
on the page. For that I use QTP Description object.
Description object is used to create a 'Properties' collection object. Each 'Property' object contains
a property name and value pair.
Set descImage = Description.Create
descImage("html tag").value = "IMG"
The above code:

1. creates Description object


2. creates "html tag" property and sets its value to "IMG"

You can use the following code to get number of all images on a Web page:
Dim descImage, listImages

' Create description for all images on a Web page.


' For that we use "html tag" property and its value "IMG"
Set descImage = Description.Create
descImage("html tag").value = "IMG"

' Get all images which match the above description


Set listImages = Browser("Google Book Search").Page("Google Book
Search").ChildObjects(descImage)

' Show the number of found images


MsgBox "Found images: " & listImages.Count
Execute the above code and you will get a result like:

How does Description object work?

Actually, QTP Description object is a part of QTP Descriptive Programming.


QTP Descriptive Programming (DP) is a way of working with objects without Object Repository
(OR).

In our example, we couldn't know all images on a Web page in advance. So, we couldn't add them
into QTP Object Repository. Instead of that, we created Description object with required property
and its value.

Tips: We can use several properties assigned to Description object. For example:
Set descImage = Description.Create
descImage("html tag").value = "IMG"
descImage("image type").value = "Image Link"

When we pass Description object to ChildObjects QTP function, it returns the collection of child
objects contained within the object (Page("Google Book Search")) and matched to Description
object.
That's why we've got the list of all images on a page.

How to get additional properties of found images?

As you remember, we planned to process each image (get its location).


Let's open OR and check the additional recorded properties:
(click the image to enlarge it)

There are "src" property, which contains the URL address of the image file.
To get this property, we can use GetROProperty QTP function.

The final code is:


Dim descImage, listImages

' Create description for all images on a Web page.


' For that we use "html tag" property and its value "IMG"
Set descImage = Description.Create
descImage("html tag").value = "IMG"

' Get all images which match the above description


Set listImages = Browser("Google Book Search").Page("Google Book
Search").ChildObjects(descImage)

' Show the number of found images


MsgBox "Found images: " & listImages.Count

' Show location ("src" property) of each image


For i = 0 To listImages.Count - 1
MsgBox "Image #:" & (i+1) & ": " & listImages(i).GetROProperty("src")
Next

This code shows a location of each image from a Web page.


There is a message box with a location of first image:

Then the second image:


and so on for others images...

Tips: Use the table of the most popular properties of Image QTP control:
# Property name Description
1 alt The object's tooltip text
2 href The location to which the browser navigates when the image is clicked
3 name The object's name
4 src The image source, i.e., the URL address of the image file
5 visible Indicates whether the object is visible.
Note: Only True and False are valid values for this property. 1 and 0 are not valid
values.
Please, refer Quicktest Professional Help for detailed info on image identification properties .

Tips: You can use the same approach to work with others UI controls - Links, WebEdit, WebList,
etc.

Automated testing without automated testing tools

How many automated testing tools exist in the world?


Hm... I think, hundreds - Selenium, QuickTest Professional, SilkTest, Jmeter, LoadRunner, STAF,
Watir, Canoo WebTest, and so on...

Is is possible to perform an automated testing without automated testing tools? Sure!

I will show how to perform automated testing of web applications on Internet Explorer (IE)
browser.
The main advantage is that these tests can be run on any Windows computer without any
additional sofware required.

Let's see steps of sample test:

1. Open IE and navigate to google.com:


2. Set value of edit box to 'Easy way to automate testing':

3. Click 'Google Search' button:

4. If a search results page contains a link to this blog (http://motevich.blogspot.com) then


click this link:

5. Last step is to close the IE window

I've automated this test with an instance of the InternetExplorer object.


Details info about InternetExplorer object is located here.

I hope, the source code of my test is clean and understandable. Here it is:
Option Explicit
Dim objIE, objLink
Set objIE = OpenBrowser("http://google.com")

' View the HTML source on Google's page to see the 'q' and 'btnG'
values
objIE.Document.All("q").Value = "Easy way to automate testing"
objIE.Document.All("btnG").Click
WaitForLoad(objIE)

' Find a link to http://motevich.blogspot.com


Set objLink = GetLinkByHref(objIE, "motevich.blogspot.com")

' If found, then click it


If (False = IsNull(objLink)) Then
objLink.Click
WaitForLoad(objIE)
End If

' Close IE window


objIE.Quit
WScript.StdOut.Write("Script completed successfully...")

''''''''''''''''''''''''''''''''''''''''''''''
' Functions

' Opens IE and navigates to specified URL


Private Function OpenBrowser(URL)
Dim ie
Set ie = CreateObject("InternetExplorer.Application")

ie.Visible = True
ie.Navigate2 URL
WaitForLoad(ie)

Set OpenBrowser = ie
End Function

' Waits for page fully loaded


Private Sub WaitForLoad(ie)
Const WAIT_TIMEOUT = 100

While (ie.Busy) or (ie.ReadyState <> 4) ' READYSTATE_COMPLETE


= 4
WScript.Sleep(WAIT_TIMEOUT)
Wend
End Sub

' Gets Link by 'href' attribute.


' Note: If your need, you can write another function - GetLinkByTe
xt
Private Function GetLinkByHref(ie, href)
Dim Link

For Each Link In ie.Document.Links


If Instr(LCase(Link.href), LCase(href)) > 0 Then
Set GetLinkByHref = Link
Exit Function
End If
Next

Set GetLinkByHref = Null


End Function

How to run this file?

1. Save this code to file, for example to ieauto.vbs.


2. To execute this file, run from command line: cscript ieauto.vbs
or paste this command to bat-file:
and run the bat-file from command line.
Note: You can download archived sample files from here.

The result of execution is:

Test
runs and performs all steps correctly (it opens IE, fills values, clicks button, clicks link, closes IE).

Conclusion:
You can create and use instances of the InternetExplorer object to perform and to test all actions,
which you run manually.
Or to do some routine operations in a browser, for example - filling forms, creating test users, and
so on.

QTP - How to capture tool tip of link?

My friend asked me - How to capture a tool tip text in QTP?


For example, how to get tool tip ('Go to My Yahoo!') from the yahoo page:
This QTP tutorial shows and explains How to get tool tip in QuickTest Professional.
Actually, this is not a difficult task. The steps are:

1. Place mouse cursor over the link


2. Wait for tool tip
3. Get text of shown tool tip

This QTP script captures a text of a tool tip:


' Place mouse cursor over the link
Browser("Yahoo!").Page("Yahoo!").WebElement("text:=My
Yahoo!").FireEvent "onmouseover"
wait 1
' Grab tooltip
ToolTip =
Window("nativeclass:=tooltips_class32").GetROProperty("text")
Please, pay attention on details:

1. We use FireEvent("onmouseover") to simulate mouse placing over the link


2. Function wait(1) waits 1 second for a tool tip
3. To get tool tip text, we use:
Window("nativeclass:=tooltips_class32").GetROProperty("text")
Let's run our code and compare captured tool tip with expected ('Go to My Yahoo!'):

As you can see, above QTP script


captures correct text of a Tool tip.
I hope, you will add this script to your QTP functions library.

How to run QTP test from command line?

Do you run your QTP tests suit manually?


What about running them on the schedule, for example nightly testing?

I will show the way how to do that - i.e. how to run QTP tests from command line.
Using that approach, you can execute your QTP tests on the schedule.
This is a script, which runs QTP tests (from the above QTP video tutorial):
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object


qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible

qtApp.Open "C:\Temp\simple_test", True ' Open the test in read-only mode

' set run settings for the test


Set qtTest = qtApp.Test
qtTest.Run ' Run the test
WScript.StdOut.Write "Status is:" & qtTest.LastRunResults.Status ' Check the results of the test
run
qtTest.Close ' Close the test

Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object

TP VIDEO - How to capture dynamic text?

This QTP video tutorial explains how to use QTP Text Output to capture dynamic text.

The present QTP (QuickTest Pro) video tutorial covers the following:

1. How to use QTP to capture text from the page


2. Settings from QTP 'Output Text Value Properties' dialog
3. Explanation for QTP Output value
4. Explanation for left & right boundaries
5. How to save QTP Output text value into QTP DataTable
6. Differences between Global and Local QTP DataTable sheets
7. How to read value from QTP DataTable

How to capture dynamic text

Dear Reader!

• Do you have comments on this QTP video tutorial?


• Do you have suggestions for future QTP video tutorials?
• Do you have interesting thoughts to share with us?
• Do you have plans on how to cooperate with me and my blog?
• Do you have bright ideas on automated testing?

How to execute QTP script from LoadRunner?

I'm a big fan of LoadRunner! Really. This is a wonderful tool for load and performance testing.
Also, I like QTP. Not love it, just like :) It's powerful enough.

That's why I decided to use them together - i.e. execute QTP script from LoadRunner.

I recorded simple QTP script - it just opens Google, performs search, then it clicks 'Next' button,
and closes browser:

QTP script is quite clear, I hope :)


But I faced the questions:

• Should QTP be installed or not?


• Can several QTP scripts be executed simultaneously on one computer?
• Is it required special license for QTP and/or LoadRunner?
• How to do that - hotw to execute QTP script from LoadRunner?
• and others questions...

It's OK :) I will share my experience and help you to answer these questions!
Let's sort them out one after another...

1. Should QTP be installed or not?


The answer is 'Yes'.

If you plan to execute QTP scripts, QTP should be installed on Load Generator computer
(or computers, if you to execute several concurrent QTP scripts).

I tried to execute QTP script on computer, where QTP was not installed, and I got this
error:

2. Can several QTP scripts be executed simultaneously on one computer?


Actually, answer is 'Yes and No' :)
I will explain...

How does QTP work? It takes full control on GUI desktop of computer. Each computer has
one desktop only.
That's why there is a limitation: you can run one QTP script per computer!

Certainly, I tried to execute two QTP scripts on one Load Generator. One user passed
successfully and second generated the error:

That means, that limitation


(one QTP script per computer) works.

But you can evade this restriction - use Terminal server or Citrix server. They allow to
create several virtual desktops. And you will be able to execute several QTP scripts on one
physical computer.

I think, I explained my answer 'Yes and No' to above question :)


3. Is it required special license for QTP and/or LoadRunner?
o To run QTP script itself you have to have QTP license - seat or concurrent license.
o To run QTP script from LoadRunner you have to have "GUI" Vuser LoadRunner
license.

Since you have both QTP and LoadRunner licenses, it's expensive enough to run QTP
scripts from LoadRunner.

Note: Each QTP instance should have its license. If you use concurrent licenses and plan
execute 10 QTP scripts, then each QuickTest will require license - You should provide 10
seat or concurrent licenses.
I think, it is logical.

4. How to do that - how to execute QTP script from LoadRunner?


Yeah! The most interested question :)

The steps are:

1. Record and save QTP script.


You saw my recorded simple QTP script. I named it as 'QTP-LR'. OK
2. Start LoadRunner Controller.

Note, that QTP scripts can be executed in LoadRunner Controller. You cannot use
LoadRunner Generator to run or debug QTP script.

3. Select 'New Scenario...'.


'New Scenario' dlg will be opened. Do not forget to select 'Quick Test Tests' from
combobox:

4. Open QTP script.


Note, that 'Quantity' field will contain value '1', i.e. one user will be run:

That's funny,
LoadRunner set correct 'Quantity' value in Scenario Groups settings, but it forgot to
set correct values in Scenario Schedule section:

It seems like a small


bug :)

Execute scenario.
You will find that your QTP script works - it will be starting a browser,
performing search, clicking 'Next' btn and closing browser during 5 minutes
(default time from Global Schedule settings)

Congratulation! QTP script runs from LoadRunner.

As you can see - there is nothing difficult :)

Thank you for your attention, my dear reader.


And feel free to ask me or suggest interesting subjects for further articles.

QTP - How to set/get system time and date?

QTP allows running different types of test. And sometimes, it needs perform time and date
manipulations on a computer. In this article, I will show and explain - how to get system time/date
and change them.

Actually, today's lecture consists of two questions:

1. How to get system time and date?


2. How to set system time and date?

Let start training right now :)


So, the first section is:

How to get system time and date?

Actually, this is not difficult task! Use the following functions:

• Now - function returns the current date and time according to the setting of your
computer's system date and time.
• Date - function returns the current system date.
• Time - function returns a Variant of subtype Date indicating the current system time.
So, the code is very simple. I provide it with a screen shot containing results:

Well, let's deal with the second section:

How to set system time and date?

For that, I will use simple DOS commands:

• time - this command displays or sets the system time:

To change the time, pass it


as a parameter to time command. See the above screen shot as an example.

• date - this command displays or sets the system date:

To change the date, pass it as


a parameter to date command. See the above screen shot as an example for date
manipulations :)

Now, I will combine all the above VBScript functions (Now, Date, Time) and DOC commands
(time and date):
As you can see, initial date and time were '26.10.2007 22:45:10'. Then I added 3 days and 2 hours
to initial date & time. The result of addition is - '30.10.2007 0:45:10'.

By the way, could you guess, why the result day is 30th, not 29th? :) To answer, please pay
attention that we added 2 hours too :)

The last step - running of time and date commands from command line. I used Run method of
WScript.Shell object.

So, as you can see - date and time manipulation is easy enough.

TP - How to get font size/color, background color and other attributes of controls

Today I faced with the following task with QTP (QuickTest Professional) - how to get some
attributes (such as: font size, font color, background color and so on) for any control on a web
page?

Piece of cake! :)
Let's see ways how it can be done.

The task: get font size, font color, background color and others possible parameters from the
gmail.com start page:

The solution:

1. First of all, I tried to use GetROProperty method.


I selected "Welcome to Gmail" label with QTP object spy and added them to Object
Repository:
Well, now I know the class
of web control - WebElement.

Then, I open QuickTest Professional Help, search for "WebElement Identification


Properties" and see that there are not needed properties (font name, font color, size, ...).

Help reading shown that it is possible to get needed properties for some objects, for
example, for Link. Please, see "Link Identification Properties" from the QTP Help:

Property Name: Description

o background color: The link's background color.


o color: The link's color.
o font : The link's font.

So, these properties work correctly for Link. For example, the following code:
Browser("Welcome to Gmail").Page("Welcome to Gmail").Link("About
Gmail").GetROProperty("color")
returns value #0000ff for "About Gmail" link:

In terms of RGB (red-green-blue),


the value #0000ff means that blue-color is enabled.
It looks like truth :)

This approach (GetROProperty method) has a limitation - it can be applied for some
objects. In my case (I use WebElement object) this methods cannot be applied.

Thanks to Mr. Google :) It found an appropriate solution:

2. currentStyle object!
The main idea is to read:
WebElement("SomeName").Object.currentStyle.someProperty
For example, use:
o color property to get the color of the text
o backgroundColor property to get the backgroung color (behind the content of the
object)
o fontSize property to get the font size
o fontStyle property to get the font style
o fontFamily property to get the font family
o fontWeight property to get the font weight
o and so on

Please, read more detailed info on properties of currentStyle object:

So, I used this code in my QTP script:

Dim ctrlWebEl, objWebEl

Set ctrlWebEl = Browser("Welcome to Gmail").Page("Welcome to


Gmail").WebElement("Welcome to Gmail")
Set objWebEl = ctrlWebEl.Object

sColor = objWebEl.currentStyle.color
sBackgrColor = objWebEl.currentStyle.backgroundColor
sFontSize = objWebEl.currentStyle.fontSize
sFontStyle = objWebEl.currentStyle.fontStyle
sFontFamily = objWebEl.currentStyle.fontFamily
sFontWeight = objWebEl.currentStyle.fontWeight

Result is:

The last thing I have to do is to get a numerical value of background color.


For that I recorded another object - WebElement("corner_tl"):
Note: when recording, click at the right of "Welcome to Gmail" text.

I executed my QTP script for that WebElement and got results:

Background color is #c3d9ff

Now, I think, mission is completed :)


All attributes (font size/color/weight, backgroung color) are gathered.

Summary: The simple way to get different attributes of controls from QTP is a usage of
currentStyle object .

Potrebbero piacerti anche