How can we close all webbrowsers which are opened in out
desctop?

Answers were Sorted based on User's Feedback



How can we close all webbrowsers which are opened in out desctop?..

Answer / venu

The following code can be used in order to close all the IE
browsers:

SystemUtil.CloseProcessByName "IEXPLORE.EXE"

Is This Answer Correct ?    10 Yes 0 No

How can we close all webbrowsers which are opened in out desctop?..

Answer / meenakshisundharam

If browser(xxxx).Exist then
browser(xxxx).close
End if

Is This Answer Correct ?    9 Yes 0 No

How can we close all webbrowsers which are opened in out desctop?..

Answer / syam

While Browser("CreationTime:=0").Exist
Browser("CreationTime:=0").Close
Wend

QTP Tip1: The first browser that opens receives the
value "CreationTime" = 0, the second browser
receives "CreationTime" = 1, and so on...

Is This Answer Correct ?    4 Yes 0 No

How can we close all webbrowsers which are opened in out desctop?..

Answer / d.selvakumar

SystemUtil.CloseProcessByName "iexplore.exe"
pls use small letters

Is This Answer Correct ?    1 Yes 0 No

How can we close all webbrowsers which are opened in out desctop?..

Answer / chandrashekar reddy

there are 2 ways to close the all browsers in qtp
1) we can use while..... wend 2) we can use
description.create method

1) while Browser("index:=0").exist (1)
browser(index:=0).close
wend

2) set ab=description.create
ab("micclass").value="Browser"
set obj=Desktop.childobjects(ab)
b=obj.count
msgbox b
for i= 0 to b-1
names=obj(i).getroproperty("name")
msgbox name
obj(i).close

Is This Answer Correct ?    1 Yes 0 No

How can we close all webbrowsers which are opened in out desctop?..

Answer / ambadas

please give ans

Is This Answer Correct ?    0 Yes 0 No

How can we close all webbrowsers which are opened in out desctop?..

Answer / joseph

Tested in tool -
Answer 1 is right
Answer 3 is right
Answer 5(1) - Update (browser(index:=0).close) to browser("index:=0").close
Answer 5(2) - Need to include 'Next' for 'For' loop

Is This Answer Correct ?    0 Yes 0 No

How can we close all webbrowsers which are opened in out desctop?..

Answer / ram shankar

visit below URL, you can get qtp browsers scripts

http://www.gcreddy.com/2010/01/qtp-web-testing-scripts.html

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More QTP Interview Questions

what is action in QTP?

1 Answers   Infosys,


write a qtp script to see time in windows command prompt? its urgent....

9 Answers   BSL,


i've installed qtp9.2 on Windows 7. Recording and everything no problem. But when i am saving the test, it is not happening. it says 'general error while saving'. But teh test is getting saved but as a folder with lock icon. When i wanted to open it, it is jst showing as a locked folder but not as a test. Somebody help me out plz

1 Answers  


hi all, I have installed QTP successfully on windows vista. I am able to record and run on windows applications, but facing problem with web applications. While recording, I am able to open the web application, but when I click on any object or give login name and password, the events are not getting recorded in QTP. Could anyone solve the problem. Any settings to be done for web applications other than selecting web-addin? Waiting for replies. Thanks in advance.

4 Answers  


How to see entire results at the same timeafter the batch run.. Cannot see the entire results at a time. Is there a easier way view everthing at same,as our batch file very large

2 Answers  






How to execute the test cases using QTP. i.e What is the use of QTP while execution

2 Answers  


How do you handle XML exceptions in QTP (Here it is Exception, not the checkpoint)

2 Answers   CFC, CTS,


How do you open adobe acrobat file in QTP and do some testing on that file ?

0 Answers  


3. How to handle the exceptions using recovery secnario manager in Qtp?

2 Answers   Wipro,


suppose in the middle of the project QTP will not work properly, then what do u do? and ur team?

0 Answers  


Difference between action & Reusable action?

0 Answers  


What is the use of sendkeys.In which cases we Use this sendkey.Pls explain with example.

3 Answers   Cap Gemini,


Categories