Table of Contents

Class GuiSessionFactory

Namespace
HP.LFT.SDK.SAP.GUI
Assembly
HP.LFT.SDK.dll

A class for creating an IGuiSession instance.

public static class GuiSessionFactory
Inheritance
GuiSessionFactory
Inherited Members

Methods

Attach(GuiSessionDescription)

Returns a new IGuiSession instance that is attached to a session that was not opened by OpenText Functional Testing for Developers (for example, a session that was opened manually or by the AUT).

public static IGuiSession Attach(GuiSessionDescription desc)

Parameters

desc GuiSessionDescription

GuiSessionDescription for filtering the open sessions.

Returns

IGuiSession

IGuiSession for the launched session if a single matching sessions was found.

Remarks

GuiSessionDescription is used only when attaching to the session so transient properties like Name can be used.
OpenText Functional Testing for Developers recognizes SAP GUI Session and tabs that it opens (for example, via Launch(string)). If a GUI Session is opened outside of the OpenText Functional Testing for Developers context, you need to use the Attach(GuiSessionDescription) method to acquire the GUI session.

Exceptions

ReplayObjectNotFoundException

No open sessions matches the description.

ReplayObjectNotUniqueException

More than one session matches the description.

GetAllOpenSessions(GuiSessionDescription)

Returns the open sessions that match the description.

public static IGuiSession[] GetAllOpenSessions(GuiSessionDescription description)

Parameters

description GuiSessionDescription

A GuiSessionDescription containing the set of properties and values that should be common to all returned sessions.

Returns

IGuiSession[]

A collection of IGuiSession objects that are open and match the description.

Launch(SessionLaunchInfo)

Launches the SAP GUI session and logs on to the server using the user credentials and details specified in the launchInfo parameter.

public static IGuiSession Launch(SessionLaunchInfo launchInfo)

Parameters

launchInfo SessionLaunchInfo

The session launch information.

Returns

IGuiSession

The launched session.

Launch(SessionLaunchInfo, IDesktopEnvironment)

Launches the SAP GUI session and logs on to the server using the user credentials and details specified in the launchInfo parameter. Use this overload when working with a OpenText Functional Testing for Developers grid.

public static IGuiSession Launch(SessionLaunchInfo launchInfo, IDesktopEnvironment environment)

Parameters

launchInfo SessionLaunchInfo

The session launch information.

environment IDesktopEnvironment

The environment on which to launch the GUI session, obtained using the Get(EnvironmentDescription) method.

Returns

IGuiSession

The launched session.

Launch(IPAddress, int)

Opens a connection to the specified SAP server according to its IP address

public static IGuiSession Launch(IPAddress serverIP, int instanceNumber = 0)

Parameters

serverIP IPAddress

The connection IP for the SAP server to which you want to open a connection.

instanceNumber int

The server system number

Returns

IGuiSession

The launched session

Exceptions

ArgumentNullException

In case server IP is null.

Launch(IPAddress, string, string, string, int, string)

Launches the SAP Gui session and perform the log-in according to the specified user credentials on the specified server ip.

public static IGuiSession Launch(IPAddress serverIP, string client, string username, string password, int instanceNumber = 0, string language = "en")

Parameters

serverIP IPAddress

The connection IP for the SAP server to which you want to open a connection.

client string

The SAP client you want to use.

username string

The username with which you want to log on to the SAP Server.

password string

The encrypted value of the password for the specified username.

instanceNumber int
language string

The 2-letter code for the language you want to use.

Returns

IGuiSession

The launched session

Remarks

Generate the password encoded value using the Password Encoder utility (CryptonApp.exe), available from the OpenText Functional Testing for Developers menu in your IDE, or from the OpenText Functional Testing for Developers installation\bin folder.

Note: While the encrypted value hide passwords displayed on the screen while running or editing a test, it is not intended to be a secure way to protect password information.

Launch(string)

Launches the SAP Gui session on the given server description.

public static IGuiSession Launch(string serverDescription)

Parameters

serverDescription string

The server to which you want to log on. The string is case-sensitive and must be identical to the one displayed in the SAP Logon dialog box.

Returns

IGuiSession

The launched session

Launch(string, string, string, string, string)

Launches the SAP Gui session and perform the log-in according to the specified user credentials on the specified server description.

public static IGuiSession Launch(string serverDescription, string client, string username, string password, string language = "EN")

Parameters

serverDescription string

The server to which you want to log on. The string is case-sensitive and must be identical to the one displayed in the SAP Logon dialog box.

client string

The SAP client you want to use.

username string

The username with which you want to log on to the SAP Server.

password string

The encrypted value of the password for the specified username.

language string

The 2-letter code for the language you want to use.

Returns

IGuiSession

The launched session

Remarks

Generate the password encoded value using the Password Encoder utility (CryptonApp.exe), available from the OpenText Functional Testing for Developers menu in your IDE, or from the OpenText Functional Testing for Developers installation\bin folder.

Note: While the encrypted value hide passwords displayed on the screen while running or editing a test, it is not intended to be a secure way to protect password information.