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 / sireesha
If you want to close all browsers except gmail browser then you will follow this code.
set ObjDesk = Description.Creation
ObjDesk("micclass").Value="Browser"
set ObjDec =Desktop.ChildObjects(ObjDesk)
BroCount=ObjDec.Count
msgbox BroCount
if BroCount >0 then
for i=BroCount-1 to 0 step-1
if Instr(1,Browser("CreationTime=&i").GetRoproperty("name"),"gmail")=0 then
Browser("CreationTime:=&i").Close
End If
Next
End If
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is the extension of QTP local Repository? If it is .mtr then what is .bdb extension stands for?
What is data driver in qtp?
how can we compare descriptive programing with a regular expression
How to analyzing the checpoint results?
How to associate shared object repository to test in qtp?
How many types of actions are there in quicktest professional (qtp)?
How many types of recording facility are available in quicktest professional (qtp)?
Hi all Can u give me the link where we can download full version of qtp my mail id is karthic.venkitapathi@gmail.com
How does qtp recognize objects in aut?
Without using gui map editor we can recognize the application in winrunner ?
When and why to use descriptive programming?
How to export quicktest professional (qtp) results to an .xls file?
what is the diff b/w assistive and mandatary rules of object repository in QTP???
Limitations in QTP?
What is synchronization? What are the ways you can synchronize?