UFT Pro (LeanFT) .NET SDK Reference, Version 14.03
Attach Method (GuiSessionFactory)
GuiSessionDescription for filtering the open sessions.
Returns a new IGuiSession instance that is attached to a session that was not opened by LeanFT (for example, a session that was opened manually or by the AUT).
GuiSessionDescription is used only when attaching to the session so transient properties like GuiSessionDescription.Name can be used.

LeanFT recognizes SAP GUI Session and tabs that it opens (for example, via Launch(String)). If a GUI Session is opened outside of the LeanFT context, you need to use the Attach method to acquire the GUI session.
public static IGuiSession Attach( 
   GuiSessionDescription desc


GuiSessionDescription for filtering the open sessions.

Return Value

IGuiSession for the launched session if a single matching sessions was found.
HP.LFT.SDK.ReplayObjectNotFoundExceptionNo open sessions matches the description.
HP.LFT.SDK.ReplayObjectNotUniqueExceptionMore than one session matches the description.