Monday, March 21, 2011

QTP Script to get the title of all open browsers

'QTP Script to Get the title of all open browsers

Set BrowserDesc = Description.Create()

BrowserDesc("application version").Value = "internet explorer 7"

Set BrowserCollection = DeskTop.ChildObjects(BrowserDesc)

nCnt = BrowserCollection.Count
MsgBox "There are totally "&nCnt&" browsers opened"

For Ctr = 0 To (nCnt -1)

   MsgBox "Browser : #"&Ctr&" has the title:"& BrowserCollection(Ctr).GetROProperty("title")

Next  

Set bColl = Nothing
Set bDesc = Nothing

Find more QTP programs here.

No comments:

Post a Comment

Please leave your comment here...