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 UFT Developer (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. UFT Developer 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 UFT Developer context, you need to use the SAPGUI.GuiSessionFactory.attach method to acquire the GUI session.
Parameters:
NameTypeDescription
guiSessionDescriptionGuiSession | ObjectSee 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:
NameTypeAttributesDefaultDescription
serverDescriptionstringThe 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.
clientstring <optional>
The SAP client you want to use.
usernamestring <optional>
The username with which you want to log on to the SAP Server.
passwordstring <optional>
The encrypted value of the password for the specified username.
languagestring <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:
NameTypeAttributesDefaultDescription
serverIPstringThe connection IP for the SAP server to which you want to open a connection.
clientstring <optional>
The SAP client you want to use.
usernamestring <optional>
The username with which you want to log on to the SAP Server.
passwordstring <optional>
The encrypted value of the password for the specified username.
instanceNumbernumber <optional>
0 The server system number.
languagestring <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:
NameTypeDescription
guiSessionDescriptionGuiSession | ObjectA 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>>