Close All Opened Browser

Methods Used : Descriptive programming,Regular Expression and Ordinal Identifier Properties.

Call Closebrowser()

Function Closebrowser

While Browser(“CreationTime:=.*”).Exist
Browser(“CreationTime:=.*”).Close
Wend
End Functio
n

The above code will close all the browser that are opened.

Here instead of creation time other ordinal identifier can also be used.

2 thoughts on “Close All Opened Browser

  1. I am newbie to qtp,I copy pasted the above code i am getting syntax error,let me know what needs to be updated in code.

    1. Hi Swapna,
      The problem is with the double quotes when you do a copy paste from the web page to qtp.
      Please delete all the double quotes and retype the double quotes again in qtp editor.

      Regards,
      Dhanasekar S

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s