Object Model Reference for GUI Testing > SAP Gui for Windows > Close Method

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 Check Checks whether the actual value of an item matches the expected value.
Common Method ChildObjects Returns the collection of child objects contained within the object.
Method Close Closes the SAP GUI for Windows session without displaying a warning message.
Method CreateSession Creates a new SAP GUI for Windows session for the current connection.
Common Method GetROProperty Returns the current value of the description properties from the object in the application.
Common Method GetTOProperties Returns the collection of properties and values used to identify the object.
Common Method GetTOProperty Returns the value of the specified description properties from the test object description.
Common Method Output Retrieves the current value of an item and stores it in a specified location.
Method Reset Navigates to the session�s initial screen or to the specified transaction.
Common Method SetTOProperty Sets the value of the specified description properties in the test object description.
Method Sync Instructs UFT to wait until the SAP GUI for Windows session is available.
Common Method WaitProperty Waits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step.

Properties

Common Property Exist Checks whether the object currently exists in the open application.
Common Property Object Accesses 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 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 section of the Unified Functional Testing Add-ins Guide.

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 Unified Functional Testing 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

Parameter Description
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 Unified Functional Testing User Guide.

Example


 

Back to top

Sync Method

Description

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

Syntax

object.Sync ([TimeOut])

Arguments

Parameter Description
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 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 Unified Functional Testing 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 Unified Functional Testing User Guide.

Example


Back to top

See also: