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 |
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 |
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 |
Explain the difference between smart identification and object identification withn clear example. please it is very urgent
WHAT IS THE FUNCTION (HOW TO DO) THE BATCH TESTING IN TEST DIRECTOR USING MANUAL TESTING PROCEDURE?
write a VBscript code to parametrize test script using test data from sqlserver database?
What is the use of text output value in quicktest professional?
How to indentify MS-Word objects like Menubar, Toolbar, table/columns/rows/cells etc within Word document, using QTP?
how to load vbs file to qtp through scripting. plz provide the code.....
After coming to know that QTP could not identify non-standard objects, we set those non-standard objects as virtual objects using Virtual object wizard. But how can we identify that qtp could not identify non-standard objects?
Can any one tell me Difference between Keyword Driven Frame work and Hybrid framework? Its Urgent.
hi i am working with vbwindow on qtp.first i am openning qtp whenever open qtp my application not open that time generated error like "Runtime error 0" and fatal error:automation error how to solve this problem pls tell me
BEst INstitute for QTP & SELENIUM
I have to do testing for XML file using QTP. 1. I was given a sample XML, I had to edit that with my actual data and had to make a new XML-- this part is completed, I did that. 2. Now I have to copy the exact contents of that XML file and have to paste it in a web application as a request message for web appliaction processing, using QTP. So I am unable to copy and paste it in web application, please help me out.
Explain the concept of object repository & how QTP recognises objects?