Suppose there are 10 browsers opened on desktop. I want to
close all browsers except one browser in QTP. Can any one
give the code for this?

Answer Posted / rico

Assuming all 10 browsers are IE6

Set browserDesc = Description.Create()
browserDesc(”application version”).Value = “internet
explorer 6″

Set Allbrowsers = DeskTop.ChildObjects(browserDesc)
BrowserCnt = Allbrowsers.Count

For i = 0 To (browserCnt -2)
Allbrowsers(i).Close
Next

Set browserColl = Nothing
Set browserDesc = Nothing

Is This Answer Correct ?    4 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi frnds, does anybody know if there is anything called "thin point" or something in qtp? thanks in advance.

1546


How many types of recording modes are there?

588


Will down time for server and content maintenance/upgrades be allowed? how much?

605


Create flight reservation login descriptive programing (Condition: Remove the value and substitute with a variable, and then call the validation from Excel) Plz help me....... very urgent.........

1565


How can we retrieve the Bug Ids which are open&Reopen in status through QTP scrit?Please find the script which i tried... Dim objBugFactory, objBug Dim BugId Set TDConnection = QCUtil.TDConnection Set objBug = TDConnection.BugFactory If QCUtil.IsConnected then Reporter.ReportEvent 0, "Connected", "Connected to server: " + QCUtil.TDConnection.ServerName + chr (13) +"Project: " + QCUtil.TDConnection.ProjectName + chr (13) + "Domain: " + QCUtil.TDConnection.DomainName Reporter.ReportEvent 0, "Current time on server is","==>" & TDConnection.ServerTime Else Reporter.ReportEvent 1, "Not connected", "Not connected to Quality Center" End If If mybug.Status="Open" Then BugId=mybug.DefectId MsgBox BugId End If 'OR**********************************--------------------- -----********************************** If Bug_Fields("BG_STATUS").Value ="Open" Or "Re Open"Then BugId=Bug_Fields("BG_BUG_ID").Value MsgBox BugId End If

2563






How many types of status are there?

580


Mention the different actions types of qtp.

569


What is environment variable in qtp and why to use it?

539


Can we record an application running on a remote machine using qtp?

706


What are the flaws in water fall model and how to overcome it?

554


What are the ways you can synchronize?

574


What is Test Fusion Report in QTP?

611


regular expression in qtp standar check point for months from accepting months from january to december only

1467


I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format. Hence, if possible, kinldy mail PDF file to my mail-ID: sushmapokhriyal79@gmail.com

1488


What is smart identification in QTP?

618