IBM Rational Functional Tester
Version 8.1.1000
IBM Rational Functional Tester API Reference

Project Version 2.3

com.rational.test.ft.object.interfaces.SAP
Class SAPGuiApplicationTestObject

java.lang.Object   extended by com.rational.test.ft.object.interfaces.TestObject
      extended by com.rational.test.ft.object.interfaces.SAP.SAPGuiApplicationTestObject

public class SAPGuiApplicationTestObject
extends TestObject

A TestObject representing a SAPGUI Scripting GuiApplication object. Defines interfaces for SAPGUI Scripting Application object. GuiApplication represents the process in which the SAP system activity takes place. Because of this there should always be only one GuiApplication object within a process. The children of GuiApplication are all the connections of class GuiConnection to the SAP systems available for scripting.

Since:
RFT 7.0

Field Summary
 
Fields inherited from class com.rational.test.ft.object.interfaces.TestObject
ref
 
Constructor Summary
SAPGuiApplicationTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject)
          For internal use.
SAPGuiApplicationTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject, TestObject anchor)
          For internal use.
SAPGuiApplicationTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject, TestObject anchor, long scriptCommandFlags)
          For internal use.
SAPGuiApplicationTestObject(TestObject obj)
          Constructs one TestObject from another.
SAPGuiApplicationTestObject(com.rational.test.ft.object.TestObjectReference ref)
          For internal use.
 
Method Summary
 boolean addHistoryEntry(java.lang.String fieldName, java.lang.String val)
          Adds an entry to the history database so that it will be available the next time the end user accesses the text field with the given field name.
 boolean dropHistory()
          Deletes all entries from the input history
 TestObject findById(java.lang.String id)
          Locates a descendant object in the SAPGUI Scripting hierarchy with the matching id.
 java.lang.Object invoke(java.lang.String method)
          Invokes a method with no args on the object in the software under test.
 java.lang.Object invoke(java.lang.String method, java.lang.String methodSignature, java.lang.Object[] args)
           Invokes a method on the object in the software under test.
 SAPGuiConnectionTestObject OpenConnection(java.lang.String connectionDescription, boolean inSync, boolean raiseOnFail)
          Opens a connection to the SAP server
 SAPGuiConnectionTestObject openConnectionByConnectionString(java.lang.String connectionString, boolean inSync, boolean raiseOnFail)
          Opens a connection to the SAP server
 
Methods inherited from class com.rational.test.ft.object.interfaces.TestObject
compare, compare, compareAndLog, compareAndLog, equals, exists, find, find, find, findAndInvoke, findAndInvoke, findAndInvokeProxy, getActualData, getChildren, getDescribedObject, getDescribedObjects, getDescriptiveName, getDomain, getField, getIndexer, getIndexer, getIndexers, getMappableChildren, getMappableParent, getMapProperties, getMethods, getNameInScript, getNonValueProperties, getObjectClassName, getObjectCustomClassName, getObjectReference, getOwnedObjects, getOwner, getParent, getProcess, getProperties, getProperty, getPropertyFromMap, getRecognitionProperties, getRecognitionPropertyWeight, getScriptCommandFlags, getStandardProperties, getTestData, getTestDataTypes, getTopMappableParent, getTopParent, hashCode, invokeProxy, invokeProxy, isMappedObject, isSameObject, isScreenTestObject, isTopLevelTestObject, performTest, performTest, performTest, performTest, setIndexer, setIndexer, setMapProperties, setProperty, toString, unregister, updateTestData, waitForExistence, waitForExistence
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SAPGuiApplicationTestObject

public SAPGuiApplicationTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject)
For internal use.


SAPGuiApplicationTestObject

public SAPGuiApplicationTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject,                                    TestObject anchor)
For internal use.


SAPGuiApplicationTestObject

public SAPGuiApplicationTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject,                                    TestObject anchor,                                    long scriptCommandFlags)
For internal use.


SAPGuiApplicationTestObject

public SAPGuiApplicationTestObject(com.rational.test.ft.object.TestObjectReference ref)
For internal use.


SAPGuiApplicationTestObject

public SAPGuiApplicationTestObject(TestObject obj)
Constructs one TestObject from another. Both are references to the same Object.

Method Detail

invoke

public java.lang.Object invoke(java.lang.String method)
Invokes a method with no args on the object in the software under test.

Overrides:
invoke in class TestObject
Parameters:
method - The name of the method to be called
Returns:
An object of type java.lang.Object
Detail description:
Note that this can directly modify the object in the software under test and therefore should be done with extreme care. Whenever possible, you should avoid using invoke, which allows you to modify the software under test in ways that a typical user cannot. If you use this method, you should be sure to discuss its use with the developers of the software you are testing.

If the returned object is not a value class, invoke registers the object and returns a reference to the object in the software under test. As always, registered object references should be released by calling one of the unregister methods.

Since:
RFT 7.0
See Also:
invoke(String,String,Object[]), TestObject.unregister(), RationalTestScript.unregister(Object[]), RationalTestScript.unregisterAll(), RationalTestScript.getRegisteredTestObjects()

invoke

public java.lang.Object invoke(java.lang.String method,                                java.lang.String methodSignature,                                java.lang.Object[] args)
Invokes a method on the object in the software under test.

Overrides:
invoke in class TestObject
Parameters:
method - the name of the method to be called
methodSignature - the signature of the method to be called (using standard JNI syntax)
args - the arguments to be passed to the method
Returns:
An object of type java.lang.Object.
Detail description:
Invokes a method on the object in the software under test. Note that this can directly modify the object in the software under test. You should therefore be extremely careful when you do this. Whenever possible, avoid using Invoke, which allows you to modify the software under test in ways that a typical user cannot. If you use this method, be sure to discuss its use with the developers of the software you are testing.

If the returned object is not a value class, invoke registers the object and returns a reference to the object in the software under test. Registered object references are released by calling one of the unregister methods.

The methodSignature uses JNI syntax to describe the parameter types and optionally the return value types for the method. The general syntax has the parameter types in parentheses, followed by the return type: (parameterTypes)returnType. Note that the returnType is not a required part of the signature - it can be omitted. There are specific encodings for the primitive types, and then a general encoding for class types.

CodeType
Zboolean
Bbyte
Cchar
Sshort
Iint
Jlong
Ffloat
Ddouble
Vvoid
Lfully-qualified-class;For example: Ljava.lang.string;

In addition, arrays are specified by combining the brace character '[' with another type. For example, [I is an array of integers, [[I is an array of arrays of integers and [Ljava.lang.Object; is an array of Objects. Another example:

void myMethod(long n, string s, int[] arr)

has the following signature:

(JLjava.lang.string;[I)V
Since:
RFT 7.0
See Also:
TestObject.unregister(), RationalTestScript.unregister(Object[]), RationalTestScript.unregisterAll(), RationalTestScript.getRegisteredTestObjects()

findById

public TestObject findById(java.lang.String id)
Locates a descendant object in the SAPGUI Scripting hierarchy with the matching id.

Parameters:
id - The id of the object to locate
Returns:
A TestObject representing the located SAPGUI Scripting object, or NULL if one could not be located.
Detail description:
Search through the object's descendants for a given id. If the parameter is a fully qualified id, the function will first check if thecontainer object's id is a prefix of the id parameter. If that is the case, this prefix is truncated. If no descendant with the given id can be found a NULL is returned.
Example:
Unless there are several sessions or connections in use, the following calls are equivalent:

SAPGuiTextTestObject to = SAPGuiApplicationTestObject.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")

SAPGuiTextTestObject to = SAPGuiApplicationTestObject.findById("txtHEADER-FBFOOTLINE")

Since:
RFT 7.0

OpenConnection

public SAPGuiConnectionTestObject OpenConnection(java.lang.String connectionDescription,                                                  boolean inSync,                                                  boolean raiseOnFail)
Opens a connection to the SAP server

Parameters:
connectionDescription - The connection, which should be one of the values displayed in SAPLogon
inSync - Determines whether the connection should be opened synchronously or asynchronously
raiseOnFail - Determines whether a SAP exception should be raised upon failure
Returns:
The opened connection (SAPGuiConnectionTestObject)
Detail description:
Opens a connection to the SAP server.When opening connections manually SAP GUI executes the request asynchronously, so that the SAPLogon dialog remains responsive after requesting a new connection. This behaviour is also the default for SAP GUI Scripting.

The parameter connectionDescription should contain one of the descriptions displayed in SAPlogon, for example "XYZ[PUBLIC]". If you want to create a new SAP GUI instance and place it within your application you may add the suffix “/INPLACE”.

In the Scripting context it means that the call to openConnection may return before the new connection has been opened. A side effect of this is that when opening a connection fails SAP GUI displays an error popup that can not be handled from the script. This problem can be solved by setting the sync parameter to True. Then the call to openConnection will not return until a connection has been established, or an error has been detected. If sync is setto True and an error occurs an exception is raised, unless the parameter raise is set to False

Example:
SAPGuiConnectionTestObject cto = SAPGuiApplicationTestObject.OpenConnection("SAPEC1", true, false)
Since:
RFT 7.0
See Also:
SAPGuiConnectionTestObject

openConnectionByConnectionString

public SAPGuiConnectionTestObject openConnectionByConnectionString(java.lang.String connectionString,                                                                    boolean inSync,                                                                    boolean raiseOnFail)
Opens a connection to the SAP server

Parameters:
connectionString - The connection string for the SAP server
inSync - Determines whether the connection should be opened synchronously or asynchronously
raiseOnFail - Determines whether a SAP exception should be raised upon failure
Returns:
The opened connection (SAPGuiConnectionTestObject)
Detail description:
The parameter connectionData is the connection string for the SAP server, for example “/R/ALR/G/SPACE”. See the description of the openConnection method for a discussion of the sync and raise parameters.

Connection String is a technical term used within SAP GUI. A connection string describes a connection address for a destination, e.g. an SAP system's application server, similar to an Internet URL describes a location for a web page.

In its simplest form, a connection string contains an IP address and a port number. This information is sufficient for SAP GUI to open a direct TCP connection to a destination, e.g. an application server. IP address and port number are marked with the prefixes '/H/' (for host) and '/S/' (for service). Note that the port number for an SAP application server is by convention 3200 plus the two-digit SAP system number.

Example for a simple connection string with an application server's IP address (172.16.64.17) and port number (3200):/H/172.16.64.17/S/3200

Example:
SAPGuiConnectionTestObject cto = SAPGuiApplicationTestObject.OpenConnection("/H/172.16.64.17/S/3200", true, false)
Since:
RFT 7.0
See Also:
SAPGuiConnectionTestObject

addHistoryEntry

public boolean addHistoryEntry(java.lang.String fieldName,                                java.lang.String val)
Adds an entry to the history database so that it will be available the next time the end user accesses the text field with the given field name.

Parameters:
fieldName - The value that is displayed at the bottom of the dialog as "Screen Field"
val - The entry
Returns:
returns TRUE if the entry was successfully added
Detail description:
SAP GUI for Windows has an input history functionality, which displays for text fields the entries made in the past as a suggestion. With this function, an entry can be added to the history database so that it will be available the next time the end user accesses the text field with the given field name.

For a given text field, the field name can be determined by positioning the cursor on the field and pressing F1. A new window is then opened for the Performance Assistant, which has a Technical Information button. Using this will display the dialog below. The field name is displayed at the bottom of the dialog as ‘Screen field’. The functions returns True if the entry was added successfully.

Since:
RFT 7.0

dropHistory

public boolean dropHistory()
Deletes all entries from the input history

Returns:
TRUE if the history was deleted
Since:
RFT 7.0