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

What is the extension for Recovery scenario?

2 Answers  


What is an expert view and keyword view?

0 Answers  


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.

1 Answers  


How to attach a file to TD?

0 Answers  


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

0 Answers  


Could any one suggest web site links to learning VB Script for QTP purpose??

3 Answers  


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

2 Answers  


What is the difference between two actions?

1 Answers   Wipro,


What is All object and Local object in Object Repositary? Explain me please.

3 Answers  


What is the use of Regular expression?

5 Answers  


How to add verification steps to tests?

1 Answers  


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

1 Answers  


Categories