Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 / mogal

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

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

Post New Answer

More QTP Interview Questions

Are u place all QTP Framework folders in VSS?

4 Answers   TCS,


i have to prepare qtp certification course. so, please send me qtp tutorial notes.

1 Answers  


Flight reservation using input and output parameter script.

1 Answers  


Hi All, I need code for how to execute qtp scripts from excell sheet

0 Answers  


Explain about the quicktest professional (qtp) automation object model?

0 Answers  


Could some one help me the difference between GetTOProperty and SetTOProperty and when we will use these properties. and what is meant by SetToProperties..

5 Answers   Clinical Soft,


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.

0 Answers   Patni,


What is the dis advantage of check points in QTP, if any?

6 Answers   BirlaSoft,


How you know that a test case is a regression test case

1 Answers  


How to get the column count and column name from the resultset in the database connection program?

6 Answers  


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

0 Answers  


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

1 Answers  


Categories