Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No.of Browsers & Close
#1
Not Solved Question 
Hello Friends,

I develop this script... everything is okay but I am struggling to keep else part here please help me... Check it once and rectify my error..
If you give your site to close for eg "Yahoo", it is not opened here then it should show the popup or msgbox... eagerly waiting for reply

Code:
Dim bro
Set bro=description.Create
bro("micclass").value="Browser"

Set brow=desktop.ChildObjects(bro)
browco=brow.count
print browco

siteclose=inputbox("Enter your Site to Close",WebPage,"Enter Window Name")

For i=0 to browco-1
    title=brow(i).getroproperty("title")
    print "Browser Title is :    "&title
    
    Dim regEx,Match,Matches
    Set regEx=New RegExp
    regEx.pattern=siteclose
    regEx.IgnoreCase=True
    regEx.Global=True
    Set Matches=regEx.Execute(title)
    
    For Each Match in Matches
            hnd=browser("title:="&title).getroproperty("hwnd")
            'namee=browser("title:="&val).getroproperty("LocationName")
            print title&"         Page Found    It is Closing now"
            systemutil.CloseProcessByHwnd(hnd)
     Next
Next





and I tried to use systemutil.closeprocessbyname, systemutil.closeprocessbywndtitle, systemutil.closeprocessbyid...
but I can't able to close a website by using these? why? If we can use these to close please provide good example..

thanks & regards
Baba Fakruddin.D
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to close/restart UFT in "Not responding" status with AOM script CharlieMadrid 0 1,053 05-21-2020, 08:46 PM
Last Post: CharlieMadrid
  Running test with multiple browsers mvi63 0 2,670 06-25-2014, 06:49 PM
Last Post: mvi63
  Multiple 2 IE browsers are being displayed VA1405 1 1,752 01-15-2014, 07:20 AM
Last Post: basanth27
  Will Object Property Differ across browsers?? qtplearner88 7 3,758 07-30-2013, 07:18 PM
Last Post: qtplearner88
  How to close a Window obj with a "text:="& ReportName mv8167 3 2,476 02-03-2012, 10:08 PM
Last Post: rajpes

Forum Jump:


Users browsing this thread: 1 Guest(s)