Understanding Browser methods, by opening multifarious Tabs of Browser in UFT

To grasp the various common methods of the Browser Object in UFT, we’ll demonstrate by opening two tabs within the same browser instance.

Scenario: How can we open webpages in different tabs of the same browser?


  1. Launch the browser and open a webpage (e.g., “www.uftHelp.com“).
  2. Within the same instance, open another tab and redirect to a different webpage (e.g., “www.Google.com“).

To achieve this, we’ll utilize the following methods of the Browser object:

  • OpenNewTab: Opens a new tab in the existing browser window.
  • Navigate: Redirects to the given URL.
  • FullScreen: Opens the browser in full-screen mode (F11).
  • Refresh: Refreshes the opened page (similar to pressing F5).
  • DeleteCookies: Deletes the cookies from the browser.
  • CloseAllTabs: Closes all the opened tabs and the browser instance.
  • Sync: Waits for the browser to navigate to the opened URL.

Sample Code:

'Open a new Browser using Util Object
SystemUtil.Run "iexplore.exe", "www.uftHelp.com"
'Browser Sync
'Delete cookies from the Browser
'Refreshes the Opened Page
'Opening a new tab within the same browser
'Opening Browser in FullScreen mode
'Sync for new tab
'Navigate to a particular URL in the new tab
Browser("CreationTime:=1").Navigate "www.Google.com"
'Find the total number of tabs in the browser window
iTabs = Browser("CreationTime:=0").GetROProperty("number of tabs")
msgbox iTabs 'Displays the value 2
'Close all the tabs in the browser window


Was this article helpful?

Similar Posts