write a script to close all open browser in qtp except one
browser whose name is xyz
Answers were Sorted based on User's Feedback
Answer / gangadhar
set objbrowser=Description.Create
objbrowser("micclass").value="Browser"
set a=Desktop.ChildObjects(objbrowser)
msgbox a.count
for i=o to a.count-1
s=a(i).GetRoProperty("Title")
If instr(s,"Gmail")=0 Then
a(i).close
End If
Next
| Is This Answer Correct ? | 9 Yes | 1 No |
Answer / milan das
Set objbrowser=description.Create
objbrowser("micClass").value="Browser"
Set objbrwcnt=Desktop.ChildObjects(objbrowser)
msgbox objbrwcnt.count
For i=0 to objbrwcnt.count -1
If objbrwcnt(i).GetRoProperty("name")<>"xyz" Then
objbrwcnt(i).close
End If
Next
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / guest
Set odesc=Description.Create
odesc("micclass").Value="Browser"
Set a=Desktop.ChildObjects(odesc)
For i = 0 To a.count-1
t=a(i).GetRoProperty("Title")
print t
If Trim(t)<>"xyz" Then
a(i).Close
End If
Next
--Ganesh
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / pravati
set obj=Description.create()
obj("micclass").value="Browser"
set brsrobj=Desktop.childobjects(obj)
msgbox brsrobj.count
for i=0 to brsrobj.count -1
x=Browser("micclass:=Browser","creationTime:=&i-1").Getroproperty("name")
if instr(x,"xyz')=0 Then
Browser("micclass:=Browser","creationTime:=&i-1").close
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / 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 |
Answer / manjunathareddy
Dim iIndex
iIndex=0
While Browser("CreationTime:="&iIndex).Exist(1)
Title=Browser("CreationTime:="&iIndex).GetRoProperty("title")
If InStr(Title,"xyz")=0 Then
Browser("CreationTime:="&iIndex).Close
If iIndex<>0 Then
iIndex=iIndex - 1
End If
Else
iIndex=iIndex+1
End If
Wend
| Is This Answer Correct ? | 0 Yes | 1 No |
What is the use of Accessibility check point?
hi everybody this questions is only for qtp real time users. anyone please clearly explain the approach u r following for qtp testing in ur company or qtp framework u r following in ur company pelase give me clear explanation then u did great favour to inexeprienced qtp users
WHICH functionalities of QTP used in Banking project?
How can you send user defined messages to test report?
I have written some scripts in QTP by using older version, but I want to run them in latest version. Is there any process to do that.If so can anyone explain me?
What type of framework you are using in your company and explain it?
how can we test the Triggers, Cursors, Indexes while doing Database testing in DTP??
How to find the difference between 2 dates in qtp?
When we try to use test run option "Run from Step", the browser is not launching automatically why?
A web page title might be xxxx@xyz.com or xxxy@xxx.co or xyz@abc.in.Using what mandatory properties can be the page identified.Give the regular expression for that.
How to change the Default synchronization method time and where?
How to get line numbers in your editor in expert view?