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 |
How to get data from excel sheet to the script? write the script.
In Manual testing , can u prpare bug report in TD?
UFT 12.02 which ALM version will support
How is test case write?
with out object repository i need to launch IE and then navigate to a login page and then operate the objects within the page. How will be the script?
What is use of object spy?
How can I pass values from one action to another in QTP ?
what is a active x control?can any one brief me about active x controls
Hi Friends...this is surendra..recently i joined automation team ...Please send me some documents regarding VB script ...and where can i learn VB script... This is My mail id: surendra.mamilla@gmail.com... please send to my mail.... Thanx in advance surendra.
what is the defference between QTP 8.2 and 9.0and 9.2? plz tell me
whaht is the difference between CLASS & OBJECT?
How to use setroproperty?