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 |
Are u place all QTP Framework folders in VSS?
i have to prepare qtp certification course. so, please send me qtp tutorial notes.
Flight reservation using input and output parameter script.
Hi All, I need code for how to execute qtp scripts from excell sheet
Explain about the quicktest professional (qtp) automation object model?
Could some one help me the difference between GetTOProperty and SetTOProperty and when we will use these properties. and what is meant by SetToProperties..
In QTP can we feed the out of one browser(internet explorer) as an input to the another browser(mozilla firefox)? If yes explain how to do it with an example.
What is the dis advantage of check points in QTP, if any?
How you know that a test case is a regression test case
How to get the column count and column name from the resultset in the database connection program?
Hi, I have 2 dropdown listboxes called region and city/area. It needs to select one region(Santa Clara) and one city/Area (Sunnyvale).So I put this in the for loop and I am storing the Items in the variable called itemname. The regions value will get changed,so I used reg expression for this regions. This is my code Browser("MLSListings.com").Page("MLSListings.com").Link("» County/Area").Click Browser("MLSListings.com").Page("MLSListings.com").WebList ("regions").Check CheckPoint("regions") ListSize=Browser("MLSListings.com").Page ("MLSListings.com").WebList("regions").GetTOProperty("items count") For i = 1 To ListSize-1 Itemname =Browser("MLSListings.com").Page ("MLSListings.com").WebList("regions").GetItem(i+1) Browser("MLSListings.com").Page("MLSListings.com").WebList ("regions").Select Itemname ................. If I run the script,I am getting the following error, Cannot identify the specified item of the regions object. Confirm that the specified item is included in the object's item collection. Any Help? Thank you, Uma
Kindly help me with the following queries.. -- How to recognize webtable using QTP and how to use it? -- How would one conclude that it is a web table -- For Example, if there is a web table and I am clicking on say Cell A1, how would i know that i've clicked on cell A1 -- Kindly suggest me to use the web table better