To learn more about using JavaScript in LeanFT, see Setting up and working with the JavaScript SDK.
For JavaScript code samples, see Code Samples - JavaScript.

GuiSessionFactory

SAPGUI. GuiSessionFactory

GuiSessionFactory

Constructor

new GuiSessionFactory()

A class for creating an SAPGUI.GuiSessionTO.

Methods

attach(guiSessionDescription) → {Promise.<SAPGUI.GuiSessionTO>}

Returns a new SAPGUI.GuiSessionTO 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). Parameter guiSessionDescription is used only when attaching to the session so transient properties like SAPGUI.GuiSession.name can be used. LeanFT recognizes SAP GUI Session and tabs that it opens (for example, via SAPGUI.GuiSessionFactory.launch(string). If a GUI Session is opened outside of the LeanFT context, you need to use the SAPGUI.GuiSessionFactory.attach method to acquire the GUI session.
Parameters:
Name Type Description
guiSessionDescription GuiSession | Object See SAPGUI.GuiSession or property bag which contains the set of properties and values for filtering the open sessions.
Returns:
a promise that is fulfilled with the GuiSessionTO object for the launched session if a single matching sessions was found.
Type
Promise.<SAPGUI.GuiSessionTO>

launch(serverDescription, clientopt, usernameopt, passwordopt, languageopt) → {Promise.<SAPGUI.GuiSessionTO>}

Launches the SAP Gui session.
Parameters:
Name Type Attributes Default Description
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 <optional>
The SAP client you want to use.
username string <optional>
The username with which you want to log on to the SAP Server.
password string <optional>
The encrypted value of the password for the specified username.
language string <optional>
'en' The 2-letter code for the language you want to use.
Returns:
a promise that is fulfilled with the GuiSessionTO instance.
Type
Promise.<SAPGUI.GuiSessionTO>

launchByIP(serverIP, clientopt, usernameopt, passwordopt, instanceNumberopt, languageopt) → {Promise.<SAPGUI.GuiSessionTO>}

Launches the SAP Gui session by server IP.
Parameters:
Name Type Attributes Default Description
serverIP string The connection IP for the SAP server to which you want to open a connection.
client string <optional>
The SAP client you want to use.
username string <optional>
The username with which you want to log on to the SAP Server.
password string <optional>
The encrypted value of the password for the specified username.
instanceNumber Number <optional>
0 The server system number.
language string <optional>
'en' The 2-letter code for the language you want to use.
Returns:
a promise that is fulfilled with the GuiSessionTO instance.
Type
Promise.<SAPGUI.GuiSessionTO>

openSessions(guiSessionDescription) → {Promise.<Array.<SAPGUI.GuiSessionTO>>}

Returns the open sessions that match the description. The SAPGUI.GuiSession is used only when attaching to the sessions so transient properties like SAPGUI.GuiSession.name
Parameters:
Name Type Description
guiSessionDescription GuiSession | Object A SAPGUI.GuiSession containing the set of properties and values or property bag which contains the set of properties and values that should be common to all returned sessions.
Returns:
a promise that is fulfilled with a collection of SAPGUI.GuiSessionTO objects that are open and match the description.
Type
Promise.<Array.<SAPGUI.GuiSessionTO>>