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
// 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" });
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. |