Share this page

Attach Method (BrowserFactory)
Returns a new IBrowser instance that is attached to a browser tab that was not opened by OpenText Functional Testing for Developers (for example, a browser tab that was opened manually or by the AUT).
Remarks
BrowserDescription is used only when attaching to the browser so transient properties like BrowserDescription.Url and BrowserDescription.Title can be used.
OpenText Functional Testing for Developers recognizes browser windows and tabs that it opens (for example, via Launch(BrowserType)). If a browser is opened outside of the OpenText Functional Testing for Developers context, you need to use the Attach method to acquire the browser tab or window.
Examples:
- A browser tab was opened manually while setting up a scenario prior to running a 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
    )

Parameters

description
  BrowserDescription for filtering the open tabs.

Return Value

IBrowser for the launched browser if a single matching browser was found.
Example

    // Use "Attach" to connect a new (or replacement) browser tab with the OpenText Functional Testing for Developers test.
    IBrowser aboutTab = BrowserFactory.Attach(new BrowserDescription
    {
        Title = "My Sample Title Page"
    });

Exceptions

Exception | Description
--- | ---
HP.LFT.SDK.ReplayObjectNotFoundException | No open browser tab matches the description.
HP.LFT.SDK.ReplayObjectNotUniqueException | More than one browser tab matches the description.

Tips to improve your search results... OpenText™ Functional Testing for Developers .NET SDK Version: 25.2 OpenText™ Functional Testing for Developers SDK 25.2 All View Local Help Center View Online Help Center Version: