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

How to remove the associated function library?

532


How QA specialist can identify when programmatic descriptions are useful?

1974


terminal services client

1791


Explain xml checkpoints.

604


Is it possible to use two instances of UFT on the same machine? If not why?

605






What are the different types of recording modes?

540


How to handle the exceptions using the recovery scenario manager in qtp?

573


what is the structure for the data driven framework

1487


What is the expert view?

557


I want to know can we integrate visual source safe tool with QTP and QC for our version controlling process? WE know QTP and QC 10.0 version is having the version control inbuilt in it but I want to know the merits and demerits of the inbuilt version control tool and the visual source safe tool using QTP and QC.

2471


How many types of Automation frameworks are there in UFT? Describe them.

559


How to do call a output parameter from one action to another action??/

1875


What is the XML file architecture ?

1556


Hi, I am using 2 excel sheet.First excel sheet works fine with the script, if it opens the 2nd excel sheet,it works fine,but after finish all the rows it is giving the following error in the following line. InValid Procedure call or argument Line (178): "Browser("name:="&result,"application version:=internet explorer 7").Page ("title:=bgt.*", "index:=0").WebList ("name:=SearchType","html id:=Select1","location:=0").Select SearchType1". I have seen a web article says that,If we use any vbscript friendly name it may gives the above error-Invalid procedure call or argument not sure,Am I using any VBScript frienlyName? in the above line? [but the same line is perfecly working for first Excel ] It is little urgent. Any Help Thanks you

1447


Describe the differences between functions and actions in UFT?

613