Attach Method (BrowserFactory)
Returns a new IBrowser instance that is attached to a browser tab that was not opened by UFT Developer (for example, a browser tab that was opened manually or by the AUT).
BrowserDescription is used only when attaching to the browser so transient properties like BrowserDescription.Url and BrowserDescription.Title can be used.

UFT Developer recognizes browser windows and tabs that it opens (for example, via Launch(BrowserType)). If a browser is opened outside of the UFT Developer context, you need to use the Attach method to acquire the browser tab or window.
- A browser tab was opened manually while setting up a scenario prior to running a UFT Developer test.
- A test step clicks a link in the AUT that opens a new or replacement browser tab or window.

C# Syntax

public static IBrowser Attach( 
   BrowserDescription description


BrowserDescription for filtering the open tabs.

Return Value

IBrowser for the launched browser if a single matching browser was found.
// Use "Attach" to connect a new (or replacement) browser tab with the UFT Developer test.
IBrowser aboutTab = BrowserFactory.Attach(new BrowserDescription
    Title = "My Sample Title Page"
HP.LFT.SDK.ReplayObjectNotFoundExceptionNo open browser tab matches the description.
HP.LFT.SDK.ReplayObjectNotUniqueExceptionMore than one browser tab matches the description.