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
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 |
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 |
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 |
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 |
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 |
Answer / arunsingh
By using
SystemUtil.CloseProcessByWndTitle "*.*", True
| Is This Answer Correct ? | 4 Yes | 3 No |
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 |
Method1:
While Browser("creationtime:=0").Exist(0)
Browser("creationtime:=0").Close
Wend
Method 2:
Set odesc = Description.Create
odesc("micClass").Value = "Browser"
Set oBrowCO = Desktop.ChildObjects(odesc)
For i = oBrowCO.Count - 1 to 0 Step -1
Browser("CreationTime:="&i).Close
Next
method 3:
Systemutil.CloseProcessByName "Chrome.exe"
| Is This Answer Correct ? | 0 Yes | 0 No |
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 |
What is the extension for Recovery scenario?
What is an expert view and keyword view?
What is log file? what is the use of Log fine. How to create? what are the contents and the main advantages of log files. plz do help me in this concepts as i have an interivew on qtp in a couple of days. plz do help me.. thanks in Advance.
How to attach a file to TD?
I have to automate excel features using qtp in this i need to open instance of excel in different ways like double click on file, drag & drop options, File > open option but i know the 2 ways to open the excel instance 1 is by creating the object and another is to open the excel file in already opened instance of excel through sendkeys through qtp. But i m not geting how to open excel file through double click and drag and drop option through qtp script plz help me out anyone can thanks in advance
Could any one suggest web site links to learning VB Script for QTP purpose??
Hi All, What is an XML Checkpoint in QTP? How can i use it while testing a web application? Kindly explain in detail. Thanks in advance
What is the difference between two actions?
What is All object and Local object in Object Repositary? Explain me please.
What is the use of Regular expression?
How to add verification steps to tests?
Suppose i have some records in database now i want to use first 1000 records for one test and next 1000 to 2000 records for another test how can we do this just for ex oracle database pls tell me