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

Can we use Virtual Objects in Discriptive Programming?

5 Answers   Keane India Ltd,


Generic function to search for the unique link in webtable and click on it

0 Answers  


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

0 Answers  


What are the differences between table and db checkpoints?

0 Answers  


Hi, Is there any function or vbscript in QTP to clear the cookies,sessions. Please help me in this.

6 Answers  






Will QTP gets installed on virtual PC.What is the maintenance number to be given

1 Answers  


how will u do database testing in qtp? how will u do the same with descriptive programming?

1 Answers   Ordain Solutions,


What are the different types of Database checkpoints in QTP? when they are used?

2 Answers  


suppose by navigation i went from 1st page to 5th page write a script for coming from any page to the 1st page abd by executing where the page may be . it will come to 1st page give the code using gmail. give me mail id so that i can under this answer with out any doubt

1 Answers  


Basically why we need testing?

14 Answers  


Where we can use the synchronization?

0 Answers  


Explain the qtp test phases.

0 Answers  


Categories