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 |
Have you done batch testing in qtp? If yes how you are doing?
Where is the Bitmap checkpoint information stored?
how to write script in qtp(vbscript)..i mean with out application deployed..and how to call script1 into script2?
8 Answers INCA, Infosys, Logix, SLK Software, Symphony, Wipro,
what is key word driven frame work ? why it is called like that ? what is the diference between keyword driven and data driven frame work ?
Synchronizing test
What is the script for database check point, bitmapchek point, regular expression ?
What kind of errors can b handled in QTP in real time scenario?
I have test cases in excel sheet but i am using quality center.How can i copy the testcases from excel sheet to quality center?explain this process.
wt is memory leakage?
How to handle Dynamic Arrays?
how to test globalisation testing using qtp? lets take an example: suppose i have to test the word is in hindi "ratikanta", how we test it by using descriptive programming or any method??
How to change the screen name while running the test.