Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sendkeys to close an open web browser
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
This will close the last opened browser.

Code:
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
Reply


Messages In This Thread
RE: Sendkeys to close an open web browser - by wheelercha - 03-05-2010, 02:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to close/restart UFT in "Not responding" status with AOM script CharlieMadrid 0 1,229 05-21-2020, 08:46 PM
Last Post: CharlieMadrid
  DP Web Browser/Page issues rstimers 1 2,436 08-14-2015, 12:37 PM
Last Post: venkatesh9032
  Cannot find the "[ WebEdit ]" object's parent "[ Browser ]" (class Browser). Verify t Divya Roopa 1 8,460 03-11-2014, 12:13 PM
Last Post: devarapallliramana
  Getting the complete width and height of the web browser using qtp learnQtptips 1 4,380 05-27-2013, 01:17 PM
Last Post: ravi.gajul
  Function to create web objects (like Browser, Link, Page, etc) Arena 2 3,819 04-03-2012, 08:21 AM
Last Post: Arena

Forum Jump:


Users browsing this thread: 1 Guest(s)