Share this page

# 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:

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>>

Tips to improve your search results... UFT Developer JavaScript SDK Reference Version 15.0-15.0.2 UFT Developer SDK Reference All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: