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
Hi frnds, does anybody know if there is anything called "thin point" or something in qtp? thanks in advance.
What are the ordinal identifiers in web page?
Both static and dynamic arrays are handled by the vb script. Is it true?
what is defenetion of kiran can u tell me plz CVS, SVN
Which environments are supported by hp qtp?
how can i sent QTP results to the Html, notefile ,xl file give me the code using g mail login page
what is the diff between manual test plan document and automation test plan doc.can u explain indetail.
Hi All , How can we decicde for pariticular frame(DataDriven or Keword Driven)in Project? Thanks Balaji
Mention the different actions types of qtp.
What is optional step in qtp? How you can add optional step in qtp?
What is qtpro? What is a quick test professional?
Describe function procedure in vbscript.
Name the different types of recording modes?
Is it possible to refer the same object for referring more than one object that are of different class using the descriptive programming approach? Suppose my code is 'To create the object named as obj Set obj=Description.Create() 'To define the values obj("title").value="IE" obj("type").value="text" obj("html tag").value="INPUT" 'To set the value Browser("IE").Page("Yahoo").WebEdit(obj).Set "xyz" Can I refer the "obj" object for the three objects like Browser,page and webedit objects? If so how?
What are the steps involved in recovery scenario wizard?