How to activate a web browser and sendkeys for closing it?
i have written the script as follw
Set WshShell = CreateObject("WScript.Shell")
Browser("name:=Google").Activate
wait(3)
WshShell.SendKeys ("%{F4}")
But it is not working.....
WORNING: no method like 'Activate' for web page
can anybody correct it??
Thanks
(03-05-2010 01:18 AM)prasadworld321 Wrote: [ -> ]How to activate a web browser and sendkeys for closing it?
i have written the script as follw
Set WshShell = CreateObject("WScript.Shell")
Browser("name:=Google").Activate
wait(3)
WshShell.SendKeys ("%{F4}")
But it is not working.....
WORNING: no method like 'Activate' for web page
can anybody correct it??
Thanks
This will close the last opened browser.
Function CloseLastOpenedBrowser()
Dim oDescription
Dim BrowserObjectList
Dim oLatestBrowserIndex
Set oDescription=Description.Create
oDescription("micclass").value="Browser"
Set BrowserObjectList=Desktop.ChildObjects(oDescription)
oLatestBrowserIndex=BrowserObjectList.count-1
Browser("creationtime:="&oLatestBrowserIndex).close
Set oDescription=Nothing
Set BrowserObjectList=Nothing
Print "Close Category Total Report browser pdf"
Reporter.ReportEvent 0, "Browser PDF" , "Report closed successfully"
End Function
Thanks.
it is working perfectly.
But i need to check the functionality of (Alt+F4)
Here i want to use the Key (Alt+F4) to close a web page in internet explorer 7.
Please guide me how to use the 'Sendkeys' method