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.



There is one parent browser and 'n' number of child browsers on desktop. Write a code to..

Answer / 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

More QTP Interview Questions

If there r 1000 test scripts that were written. If a change to any functionality is to be made then how can we know in which script is this functionality existing.

4 Answers   iGate,


i have an external excel datasheet where it only contains 3 rows. after qtp executed the code to import the datasheet, the datatable getrowcount method now gives me a different value, lets say 60,000+ instead of only 3. i did not have any values starting from row 4 of my excel file. why is this happening? this also results to the qtp report to load for a very long time.

0 Answers  


If an application name changes frequently i.e while recording it has the name, in this case, how do qtp handles?

0 Answers  


what is the difference between parameters and arguments?

1 Answers  


X flies from Hyd to bangalore using different methods of transportation. write the test scenarios and test cases for this?

0 Answers   Virtusa,






does test plan is in test strategy or test strategy is in test plan

2 Answers   Tanla Solutions,


How to handle the exceptions using recovery scenario manager In QTP?

2 Answers  


Suppose there are 100 links in a web page and the number of links will be changing dynamically from time to time. I need code such that every time i had to click on the last link of the web page.

4 Answers   Virtusa,


It is very difficult to test in manual for that we go to DATA DRIVEN TEST.

3 Answers  


suppose u hav a dialog or window which contains 10 buttons with same name & value. now how to check each button? i.e. how qtp indetifies these objects separately?

2 Answers  


DEFECT LIFE CYCLE,WHO PUT THE STATUS AS OPEN

4 Answers   IGT,


How to release all resources file from the QTP?

0 Answers   Tech Mahindra,


Categories