write a script to close all open browser in qtp except one
browser whose name is xyz
Answer Posted / lak
dim oBrowser,oAllBrowser,nProcessId,nCounter
set oBrowser = Description.Create
oBrowser("micclass").vlaue="Browser"
set oAllBrowser = Desktop.childObjects(oBrowser)
for nCounter=0 to oAllBrowser.count-1
if(instr(oAllBrowser(nCounter).getRoProperty
("title"),"xyz"))<=0 then
nProcessId = oAllBrowser(nCounter).getRoProperty("process
id")
Systemutil.closeProcessById nProcessId
End if
else
oAllBrowser(nCounter).close
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Consider one application is open, clicking one menu will open another application in another browser. QTP does not catch the URL of the second browser(second application). can we capture it ?
How to use Environment parameterization? Explain with an example.
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
I want two test two agents login for the flight website. Here is the scenario: I want to go through 1-3 rows for one user login and other user login I want to go though 3-5 rows. How would you set this up in qtp. Thank You
What are main panes available in qtp test browser?
Please guide me release notes of Automation once scripts are completed
What is the difference between QTP and WinRunner? Why do you choose only QTP for automation among remaing tools like Rational robot and silk test? Write the VBscript for any functionality in your project ? What is the cost of QTP ? If you entered into yahoo mail with your valid user name then you will get FOR EXAMPLE , " welcome to krishna " on the top of inbo page , how can you test it in QTP? What type of testing you can do, when we gave you 5 screens and how can you test that application? What type of framework you are using in your company and explain it?
On what document base Descriptive programming is written if build is not yet ready ?
I want to capture data(using keyword) from msdos application using QTP?... Below is little work i could do on it... /* Set app=CreateObject("Wscript.shell") SystemUtil.run ("C:\Users\Agent\Desktop\pumpsim\PUMPSIM.EXE") Window(“PUMPSIM.EXE”).Activate wait(3) app.sendkeys "N" */ Thanks in advance...!!!
What is a recovery scenario?
I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format. Hence, if possible, kinldy mail PDF file to my mail-ID: sushmapokhriyal79@gmail.com
in qtp 3 sheets is there in data table like global, action1, action2. I want to check the rows and columns in action2. how can check using script?
What are the views available in quicktest professional?
Difference between test object and run time object?
How smart identification works in qtp ?