Suppose there are 10 browsers opened on desktop. I want to
close all browsers except one browser in QTP. Can any one
give the code for this?
Answer Posted / sireesha
If you want to close all browsers except gmail browser then you will follow this code.
set ObjDesk = Description.Creation
ObjDesk("micclass").Value="Browser"
set ObjDec =Desktop.ChildObjects(ObjDesk)
BroCount=ObjDec.Count
msgbox BroCount
if BroCount >0 then
for i=BroCount-1 to 0 step-1
if Instr(1,Browser("CreationTime=&i").GetRoproperty("name"),"gmail")=0 then
Browser("CreationTime:=&i").Close
End If
Next
End If
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
what testplan contents and what test strategy contents,what is the diff b/w them
How you are developing the script? Using record and play back or manual?
I would like to directly import XL file and work on that XL file directly in QTp script in that XL sheet need to allocate workbench,XL sheet and generate two bar graphs automatically how to do that? plz let me know any answers?
I need to pull the data from the page which in row, column vice into excel sheet, how can it be done using QTP? eg: Name Dept xyz gdty i need the same data to be exported in excel sheet.
what is the difference between IE & Netscape in web testing on a log in page
In a flight window we have to enter the name and meal request for every passenger.In that window if we give Total passengers=1 then the Psngr1 name field and psngr1 meal request field will reflects.if we give Total passengers=2 then Psngr1 name field and psngr1 meal request field,Psngr2 name field and psngr2 meal request field will reflects and so on.if total psngrs=100 then will we capture all the fields for the psngrs to Automate the app how we can handle this scenerio thru Descriptive programming?
How many number of actions possible in qtp?
What is a quick test professional?
Does Low-level recording capture mouse movements?
What is Distributed testing? How does UFT support it?
What is accessibility check point?
How you can find length of array in qtp?
How many types of run modes are there in qtp?
Hi Friends, I worked with 8.2 not with 9.2. Please help me in this prob. I created one script and recorded some think and save as Test 1 then I opened process--open the object repository manager. Switch to file->save->give some name->save as Objectrepo1.tsr file. (This is the global repository file.) Then I went to object repository->tools-> associate repository ->click + icon ->open the previously saved Objectrepo1.tsr file. This is the global repository Now I created one more script and save as Test 2. In this script I am calling script with the Help of "Call of existing action" and I executed but QTP is not able to execute B’cos it is QTP is not able to read the Object Repository of Test 1. Please let me know why? Once I made Script 1 as a shared Obj. Repository so it would not give any Problem. Right?
I want to know what are QTP functons and what are VB script functions. What is the difference between them.When we have to use these functions.