There is one parent browser and 'n' number of child browsers
on desktop. Write a code to close all the child browsers but
parent browser should not be closed.

Answer Posted / vishnu

'Create Description Object
Set oDesc = Description.Create
oDesc("micclass").Value = "Browser"
oDesc("openurl").Value = "about:Tabs"

'Loop through the collection and close each browser
If Desktop.ChildObjects(oDesc).Count > 0 Then
For X = Desktop.ChildObjects(oDesc).Count To 1 Step -1
Browser("CreationTime:="&X).Close
Next
End If

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to acess a test in RSA?

1768


How do you create regression test packs?

714


What is qtpro? What is quick test pro?

674


What is the purpose of loading qtp add-ins?

711


Dear Friends, I having total 3+year experience in manual testing including automation testing QTP, if i am attending any interview what kind of question will i get? please help me out

1680






What are the different recording modes and how do they work?

702


Hi ,Can any one pleas explain how to test splash objects using QTP?

1993


Why qtp the best testing tool?

650


hi to all, i need a code.. in flight application 1.i need to login first then i need to insert 3 new orders... 2.i have to log out 3.i have to login again with different user 4.need to insert 2 new orders 5.then need to log out 6.then again login with different user 7.3 new orders create and log out 8.but we hv to do this using data table and actions please help me

1855


Explain data driven framework?

658


How to analyzing the checpoint results?

608


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

640


In a flight window we have to enter the name and meal request for every passenger.In that window if we give Total passengers=1 then the Psngr1 name field and psngr1 meal request field will reflects.if we give Total passengers=2 then Psngr1 name field and psngr1 meal request field,Psngr2 name field and psngr2 meal request field will reflects and so on.if total psngrs=100 then will we capture all the fields for the psngrs to Automate the app how we can handle this scenerio thru Descriptive programming?

1552


Do you know how to connect database? Can you tell me the procedures?

621


What is the short cut keys for the following?

710