if there r 10 windows open in QTP write a command to close
all 10 windows at a time ?

Answers were Sorted based on User's Feedback



if there r 10 windows open in QTP write a command to close all 10 windows at a time ?..

Answer / sandip

Option Explicit
Dim ObjBrow,ObjName,ObjBrowName
Set ObjBrow = Description.Create()
ObjBrow(micClass).values = "Browser"
ObjName = Desktop.ChildObject(ObjBrow)
msgbox = ObjName.count
for i = 0 to ObjName.count
ObjBrowName = ObjName(i).getROproperty("Name")
msgbox(ObjBrowName)
ObjName(i).close
Next

Thanks,
Sandip Gami,
Cell No: 09986645937

Is This Answer Correct ?    11 Yes 1 No

if there r 10 windows open in QTP write a command to close all 10 windows at a time ?..

Answer / kamaldeep singh

If u are using iexplore then use this function
SystemUtil.CloseProcessByName ("iexplore.exe")

For mozilla only change the name i.e iexplore.exe

Is This Answer Correct ?    5 Yes 0 No

if there r 10 windows open in QTP write a command to close all 10 windows at a time ?..

Answer / srinadh

You can use the following function. or simply
SystemUtil.CloseProcessByName "IEXPLORE.EXE"

Public Function CloseBrowser()

SystemUtil.CloseProcessByName "IEXPLORE.EXE"

End Function

Is This Answer Correct ?    4 Yes 1 No

if there r 10 windows open in QTP write a command to close all 10 windows at a time ?..

Answer / venkat

3 menthods are these to close browsers

1) SystemUtil.CloseProcessByName "iexplorer.exe"
2) Do While Browser("creationtime:=0").Exist
Browser("creationtime:=0").Close
Loop
3)Set objWMIService =GetObject"winmgmts:\\.\root\cimv2")
Set colProcess = objWMIService.ExecQuery("SELECT * FROM
Win32_Process")
For Each objProcess In colProcess
If UCase(objProcess.Name) = "IEXPLORE.EXE"
objProcess.Terminate()
End If
Next

Regards,
Venkat
9986635974
bangalore

Is This Answer Correct ?    3 Yes 0 No

if there r 10 windows open in QTP write a command to close all 10 windows at a time ?..

Answer / eswar

cnt = 0
Set desc = Description.Create
desc("Class Name").value = "Window"
Set s = Desktop.ChildObjects(desc)
MsgBox s.count
For i=0 to s.count-1
x = s(i).Close
cnt=cnt+1
MsgBox x
Next
MsgBox cnt

Is This Answer Correct ?    3 Yes 1 No

if there r 10 windows open in QTP write a command to close all 10 windows at a time ?..

Answer / arunsingh

By using
SystemUtil.CloseProcessByWndTitle "*.*", True

Is This Answer Correct ?    4 Yes 3 No

if there r 10 windows open in QTP write a command to close all 10 windows at a time ?..

Answer / a

By using "micclass", we should create Description object.
Then using For loop we count the Dialog objects, and close
it.

Is This Answer Correct ?    1 Yes 1 No

if there r 10 windows open in QTP write a command to close all 10 windows at a time ?..

Answer / rajesh

can u explain it clearly plzzzzzz

Is This Answer Correct ?    0 Yes 1 No

if there r 10 windows open in QTP write a command to close all 10 windows at a time ?..

Answer / ashok

closedCount = SystemUtil.CloseProcessByName("iexplore.exe")

'Display # of closed windows
MsgBox closedCount


If you want to know more refer this link
http://www.knowledgeinbox.com/documents/closingprocesses.html

Is This Answer Correct ?    2 Yes 3 No

if there r 10 windows open in QTP write a command to close all 10 windows at a time ?..

Answer / sudheer kumar putsala

if Browser("micClass:=Browser","index:=0").Exist(0) Then

Browser("micClass:=Browser","index:=0").Close


Above line of code will close all the open Browsers.

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More QTP Interview Questions

Is there any MS Access addin in QTP?

7 Answers  


How will you send values to a cell in a webtable using QTP?

2 Answers  


Login to flight app, in window flight reservation set the date field and select flyfrom as Frankfurt and verify whether flyto list box has the item FrankFurt, log the results.

1 Answers   Cap Gemini,


Synchronization methods?

8 Answers   Ordain Solutions,


how to invoke the web application through script in qtp

11 Answers   IBM,






How to perform action on objects, If two objects have the almost the same name ? example : Object 1 : "Entry of Items" Object 2 : "Items" Whenever I ask QTP to perform an action on Object 2 it performs action on Object 1. Note: The two objects are present in an Oracle Application tree.

2 Answers   Wipro,


supose i hv to acsess some functionlaties of a test in 1 machin , some part other machin how can acsess?

0 Answers   IBM,


How can i select multiple values from drop down list using vb script in qtp? and wt is the script for clicking msg box box automatically with a specific time. Thanks in advance...Kalyani.

2 Answers   Accenture, CSC,


1.explain end to end process of qc,2.how many tabs are in qc9.0,qc10.0 3.what is review, how many reviews are following in aproject 4.how will you get the requirements 5.why do we choose testing 6.how to export tc's and requirements to qc through add-ins

0 Answers  


According to use, how virtual object is different from object spy? If Qtp is not learning a sub-menues. What should we done? how would we manage on the expert view too? alkaa.dugaal@gmail.com

1 Answers   HCL,


hi can anybody help with an qtp 9.2 license key please. Thanks, Nitesh.

0 Answers  


In a page i have N number of links at a time i would like to open those links by using QTP?how to do that?

2 Answers   Wipro,


Categories