Pages

QTP-script close All Browsers



 'Suppose there are 10 browser ;;; write script to close all the browsers  ''The below script will close all the open browser

dim d
set d=Description.Create
d("micclass").value="Browser"
set a=Desktop.ChildObjects(d)
for i=0 to a.count-1
   a(i).close
Next


There are 10 browsers and in that 1 browser is mercury tours website.... except mercury tours browser all the other browsers should be closed Get all the browsers and for each browser get the title in the title if "mercury" word is not there then close

dim d
set d=Description.Create
d("micclass").value="Browser"
set a=Desktop.ChildObjects(d)
for i=0 to a.count-1
   s=a(i).getROProperty("title")
   if instr(1,s,"Mercury")=0 Then
     a(i).close
   End if
Next 

0 comments:

Post a Comment