If there are some browsers opened and I don't how many browsers are open, Now I want to close all the browsers that I don't know how many are opened.
What would be Descriptive programming for this in QTP using VB Script..???
Please send your answers.

Answer Posted / rangalnrt

set Objects = description.create
Objects("micclass").value = "Browser"

set Childs = Desktop.childobjects(Objects)

for i=0 to Childs.count-1 step 1

Browser("index:="&i).close

next

if Browser("index:=0").exist then

msgbox "Fail"

Else

msgbox "Pass"

End if

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is accessibility check point?

653


What are the different types of qtp test assets and their extensions?

591


What is debugging? How you debug your script?

602


Have you done batch testing in qtp? If yes how you are doing?

501


How will you check a web application for broken links using qtp?

545






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

1576


How to use Environment parameterization? Explain with an example.

1476


we use a file extension .properties why is it used and where do we use it plz help me out with detailed explanation and navigation of how to use on the QTP 8.2?

1627


Can the user toggle between using Local OR and shared OR for the same action?

554


how can i pass a "cript"as a parameter in to a function

1453


Explain runtime dynamic settings?

2018


Where can I find and view run-time data table?

517


i have two questions for regular expression :- Q1. I have date pattern eg-29/11/2011 29-11-2011 29.11.2011 Que- if any separator is there between date,month and year pattern should match else it should not match eg- pattern should not match in case of 2911-2011 Q2. let say i have a string and there is a number in between of that string eg.-Amount 30002.234 successfully credited to your account . now i have to match this pattern in such a way that even if decimal is not there pattern should match ,how i will do this using regular expression

1018


Why is action split used by qtp?

552


hi can any body give me a script for creating a modularity or keyword driven framework..i am working as a qtp tester for 2 months but still i am not exposed to framework in my company

1419