For any corporate training requirements Please mail To sudhakar@qtpsudhakar.com
Course Name Date Time Duration Type Location
An important update from QtpSudhakar. I stopped giving classroom training in MindQ Systems. I have bigger plans and I want to put an end to regular classroom training because very less people are practicing. From now onwards every session of mine is going to have explanation and practice. Everyone should practice in presence of mine and should go out of classroom with practical knowledge. So I started my own institute AnyTechLabs in Madhapur. Please reach out to +91-8328152362 for course details. Visit AnyTechLabs.com for address details.
Selenium + Cucumber 24th October 7.30 AM IST to 9.00 AM IST 45 Days WeekDay Online

A book "Cracking the QTP interview" authored by Sudhakar.Read More. Buy From FlipKart

Friday, October 9, 2009

Close latest opened Browser using QTP

Close latest opened Browser using QTP

Dim pTitle

'Calling the Function 
Call CloseLatestOpenedBrowser()

Function CloseLatestOpenedBrowser()

Dim oDescription
Dim BrowserObjectList
Dim oLatestBrowserIndex

Set oDescription=Description.Create
Set BrowserObjectList=Desktop.ChildObjects(oDescription)


Set oDescription=Nothing
Set BrowserObjectList=Nothing

End Function



Please send your Suggestions and Doubts to my yahoo group http://in.groups.yahoo.com/group/qtpsudhakar


  1. This a very good solution you provided. Thank you very much.

  2. Excellent! Thanks you very much Sudhakar

  3. Superb Code.... Thankyou very much.

  4. I want to know what url my application has opened in Internet explorer. This is not working, if you would help that will be too gratefull.

  5. Use below code. It will open and close the current browser.

    set ie = createobject("internetexplorer.application")
    ie.visible = true
    ie.navigate "URL"

    'Perform your task

    set ie = nothing

  6. excellent dude.. i have come across this question in interview.. same browser closing using function i need pass the browser creation time number as 3 and it should close the second browser..(using function) can u help me on this...