Class GuiSessionFactory
A class for creating an IGuiSession instance.
Inherited Members
Namespace: HP.LFT.SDK.SAP.GUI
Assembly: HP.LFT.SDK.dll
Syntax
public static class GuiSessionFactory
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).
Declaration
public static IGuiSession Attach(GuiSessionDescription desc)
Parameters
| Type | Name | Description |
|---|---|---|
| GuiSessionDescription | desc | GuiSessionDescription for filtering the open sessions. |
Returns
| Type | Description |
|---|---|
| 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
| Type | Condition |
|---|---|
| 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.
Declaration
public static IGuiSession[] GetAllOpenSessions(GuiSessionDescription description)
Parameters
| Type | Name | Description |
|---|---|---|
| GuiSessionDescription | description | A GuiSessionDescription containing the set of properties and values that should be common to all returned sessions. |
Returns
| Type | Description |
|---|---|
| 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.
Declaration
public static IGuiSession Launch(SessionLaunchInfo launchInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| SessionLaunchInfo | launchInfo | The session launch information. |
Returns
| Type | Description |
|---|---|
| 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.
Declaration
public static IGuiSession Launch(SessionLaunchInfo launchInfo, IDesktopEnvironment environment)
Parameters
| Type | Name | Description |
|---|---|---|
| SessionLaunchInfo | launchInfo | The session launch information. |
| IDesktopEnvironment | environment | The environment on which to launch the GUI session, obtained using the Get(EnvironmentDescription) method. |
Returns
| Type | Description |
|---|---|
| IGuiSession | The launched session. |
Launch(IPAddress, int)
Opens a connection to the specified SAP server according to its IP address
Declaration
public static IGuiSession Launch(IPAddress serverIP, int instanceNumber = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| IPAddress | serverIP | The connection IP for the SAP server to which you want to open a connection. |
| int | instanceNumber | The server system number |
Returns
| Type | Description |
|---|---|
| IGuiSession | The launched session |
Exceptions
| Type | Condition |
|---|---|
| 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.
Declaration
public static IGuiSession Launch(IPAddress serverIP, string client, string username, string password, int instanceNumber = 0, string language = "en")
Parameters
| Type | Name | Description |
|---|---|---|
| IPAddress | serverIP | The connection IP for the SAP server to which you want to open a connection. |
| string | client | The SAP client you want to use. |
| string | username | The username with which you want to log on to the SAP Server. |
| string | password | The encrypted value of the password for the specified username. |
| int | instanceNumber | |
| string | language | The 2-letter code for the language you want to use. |
Returns
| Type | Description |
|---|---|
| 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.
Declaration
public static IGuiSession Launch(string serverDescription)
Parameters
| Type | Name | Description |
|---|---|---|
| string | serverDescription | 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
| Type | Description |
|---|---|
| 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.
Declaration
public static IGuiSession Launch(string serverDescription, string client, string username, string password, string language = "EN")
Parameters
| Type | Name | Description |
|---|---|---|
| string | serverDescription | 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. |
| string | client | The SAP client you want to use. |
| string | username | The username with which you want to log on to the SAP Server. |
| string | password | The encrypted value of the password for the specified username. |
| string | language | The 2-letter code for the language you want to use. |
Returns
| Type | Description |
|---|---|
| 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.