SAPGuiSession Object

Description

Represents the SAP GUI for Windows session on which an operation is performed.

Operations

The sections below list the built-in methods and properties that you can use as operations for the SAPGuiSession object.

Note: You can also view a list and descriptions of the SAPGuiSession description properties, for use in object repository descriptions, programmatic descriptions, checkpoint and output value steps, and as argument values for the GetTOProperty and GetROProperty methods.

Methods

Common Method CheckChecks whether the actual value of an item matches the expected value.
Common Method ChildObjectsReturns the collection of child objects contained within the object.
Common Method GetAllROProperties

Returns the collection of properties and current values from the object in the application.

Method CloseCloses the SAP GUI for Windows session without displaying a warning message.
Method CreateSessionCreates a new SAP GUI for Windows session for the current connection.
Common Method GetROPropertyReturns the current value of the description property from the object in the application.
Common Method GetTOPropertiesReturns the collection of properties and values used to identify the object.
Common Method GetTOPropertyReturns the value of the specified description property from the test object description.
Common Method OutputRetrieves the current value of an item and stores it in a specified location.
Method ResetNavigates to the session's initial screen or to the specified transaction.
Common Method SetTOPropertySets the value of the specified description property in the test object description.
Method SyncInstructs UFT One to wait until the SAP GUI for Windows session is available.
Common Method WaitPropertyWaits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step.

Properties

Common Property ExistChecks whether the object currently exists in the open application.
Common Property ObjectAccesses the native methods and properties of the object.

Back to top

 

Close Method

Description

Closes the SAP GUI for Windows session without displaying a warning message.

Syntax

object.Close

Return Type

None.

IMPORTANT

This method may be useful at the end of an action or test iteration to close sessions that were opened during the test run. This ensures that each iteration begins with the same number of open SAP Gui for Windows sessions.

Tip: You can close any open session that was launched by UFT One by checking the Session cleanup option in the SAP pane of the Options dialog box, or by checking the Close the session when the test is closed option in the Record and Run Settings dialog box. For more information, see the SAP Solutions Add-in in Add-ins section of the UFT One Help Center.

Note: This method is not recorded. To add this method to your test, use the Step Generator or enter it manually in the Keyword View or Editor. For more information, see the UFT One User Guide.

Example

Back to top

 

CreateSession Method

Description

Creates a new SAP GUI for Windows session for the current connection.

Syntax

object.CreateSession

Return Type

None.

IMPORTANT

This method is recorded when you click the Create Session button in the SAP Gui for Windows toolbar.

Example

Back to top

 

Reset Method

Description

Navigates to the session's initial screen or to the specified transaction.

Syntax

object.Reset ([TransactionCode])

Arguments

ParameterDescription
TransactionCode Optional. A String value.
The code representing the transaction to which you want to navigate. If no code is specified, the session's default code (the "/n" command code) is used
Default value = "s000"

Return Type

None.

IMPORTANT

In contrast to the SAPGuiOKCode.Set method, the Reset method can be performed at any point in your test.

Tip: We recommend using this method to ensure that tests are rerun from the initial screen of the session.

Note: This method is not recorded. To add this method to your test, use the Step Generator or enter it manually in the Keyword View or Editor. For more information, see the UFT One User Guide.

Example

Back to top

 

Sync Method

Description

Instructs UFT One to wait until the SAP GUI for Windows session is available.

Syntax

object.Sync ([TimeOut])

Arguments

ParameterDescription
TimeOut Optional. A long integer value.
The timeout (in milliseconds) after which the test run continues regardless of the session status.
Default value = 0

Return Type

None.

IMPORTANT

You can optionally specify a timeout after which the test run continues regardless of the session status.

This method can be useful when invoking a new session from an existing one or when moving from a session that is open on one server to a new session on a different server.

Notes:

If you do not specify a timeout value, UFT One uses the default Object Synchronization Timeout as specified in the Run pane of the Test Settings dialog box. For more information on the Object Synchronization Timeout, see the UFT One User Guide.

This method is not recorded. To add this method to your test, use the Step Generator or enter it manually in the Keyword View or Editor. For more information, see the UFT One User Guide.

Example

Back to top

See also: