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

What are the different types of qtp test assets and their extensions?

717


What is post recovery scenario?

1750


what is error and fault in terms of software quality?

1593


Is qtp supports uni-code?

707


How many types of run modes are there in qtp?

680






Which features or drawbacks of QTP lead to the upgrade for a newer version?

657


How do you do batch testing in wr & is it possible to do in qtp, if so explain?

720


How to create runtime property for an object?

1540


what is the difference between modular framework & datadriven framework

1674


Where to use Property Let, Property Get, Property Set in UFT

467


HI Everybody, I am using QTP 9.2, I have a problem and hope everybody help me solve it. Now I need to use mouse wheel event to zoom in or zoom out in web client, but QTP can't catch this event. I look forward helping of everybody. Thank you very much.

1740


what is actually contain test report? can anybody post the test report

1567


How can you write the scripts that operate on different objects depending on run-time information?

2217


Is it possible to split an action? How?

746


HI I want to know the detials of QTP certifications such as syllabus, study Materil etc. Can any provide me all these details?? my mail ID is krishnuvk@yahoo.com

1631