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

you can use descriptives programming concepts.
"CreationTime" is a QTP browser property, which indicates
the order in which browsers were opened.
To close 1st browser --> Browser("CreationTime:=0").Close
2nd browser --> Browser("CreationTime:=1").Close.
you can use a loop to close other 9 browsers..

Is This Answer Correct ?    17 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Diff b/w Health care domain and Banking Domain?

4300


Excel sheet having some datas and some datas present in the application (in table). How will you compare these two datas? Write code to fetch datas from Excel sheet.

1590


Shall we add Local Repository to shared object repository,if yes,how we add

6131


What is test object?

786


Client is able to provide budget..he want you to choose the automation tool for the web application? which one you will select ? QTP or Selenium ? what are the reasons?

1341






Explain object spy in qtp.

692


What is a checkpoint? How many check points are there in qtp?

616


hi guys we r working in office...we write some scripts..suddenly we have a work(5min only) in out side..what will do now,,,used to system shut down or log off or lock or sleep mode,switch use or hibernate?

1680


How to integrate the qualitycenter with qtp

1861


whare exactly we have to use functions and sub routain

1927


What is the use of sendkeys and what are send keys

2053


action contains public and private functions but do we resuable that action or not..If it is reusable How..plz tell me the ans

1714


If object is not recognized by qtp but the object is standard object what is your approach?

696


What are the advantages of Object Repository?

680


I want to configure the OR and library files to a particular QTP test during run time. Note: OR and Library files are located in Quality Center. Is it possible in QTP? Anybody having code?

1483