|
IBM Rational Functional Tester Version 8.1.1000 IBM Rational Functional Tester API Reference Project Version 2.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.rational.test.ft.object.interfaces.TestObject com.rational.test.ft.object.interfaces.SAP.SAPGuiSessionTestObject
public class SAPGuiSessionTestObject
A TestObject representing a SAPGUI Scripting GuiSession object.The GuiSession provides the context in which a user performs a certain task such as working with a transaction. It is therefore the access point for applications which record a user’s actions regarding a specific task or play back those actions.
GuiSession is self-contained in that ids within the context of a session remain valid independently of other connections or sessions being open at the same time. Usually an external application will first determine with which session to interact. Once that is clear, the application will work more or less exclusively on that session. Traversing the object hierarchy from the GuiApplication to the user interface elements, it is the session among whose children the highest level visible objects can be found. In contrast to objects like buttons or text fields, the session remains valid until the corresponding main window has been closed, whereas buttons, for example, are destroyed during each server communication.
Field Summary |
---|
Fields inherited from class com.rational.test.ft.object.interfaces.TestObject |
---|
ref |
Constructor Summary | |
---|---|
SAPGuiSessionTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject)
For internal use. |
|
SAPGuiSessionTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject, TestObject anchor)
For internal use. |
|
SAPGuiSessionTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject, TestObject anchor, long scriptCommandFlags)
For internal use. |
|
SAPGuiSessionTestObject(TestObject obj)
Constructs one TestObject from another. |
|
SAPGuiSessionTestObject(com.rational.test.ft.object.TestObjectReference ref)
For internal use. |
Method Summary | |
---|---|
void |
createSession()
This function opens a new session, which is then visualized by a new main window. |
void |
endTransaction()
Ends a transaction |
TestObject |
findById(java.lang.String id)
Locates a descendant object in the SAPGUI Scripting hierarchy with the matching id. |
TestObject |
findByPosition(int x, int y)
Finds a descendant SAPGUI Scripting element at the given position |
java.util.Hashtable |
getSessionInfo()
Get technical information about the session. |
java.lang.String |
getVKeyDescription(int vKey)
translate the integer representation of a SAPGUI vKey (used in SendVKey )
to a meaningful string value. |
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)
|
void |
sendCommand(java.lang.String command)
Execute a SAP command. |
void |
startTransaction(java.lang.String transaction)
Starts an SAP transaction |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SAPGuiSessionTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject)
public SAPGuiSessionTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject, TestObject anchor)
public SAPGuiSessionTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject, TestObject anchor, long scriptCommandFlags)
public SAPGuiSessionTestObject(com.rational.test.ft.object.TestObjectReference ref)
public SAPGuiSessionTestObject(TestObject obj)
Method Detail |
---|
public java.lang.Object invoke(java.lang.String method)
invoke
in class TestObject
method
- The name of the method to be called 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.
invoke(String,String,Object[])
,
TestObject.unregister()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.unregisterAll()
,
RationalTestScript.getRegisteredTestObjects()
public java.lang.Object invoke(java.lang.String method, java.lang.String methodSignature, java.lang.Object[] args)
invoke
in class TestObject
method
- the name of the method to be calledmethodSignature
- the signature of the method to be called (using standard JNI syntax)args
- the arguments to be passed to the method 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.
Code | Type |
---|---|
Z | boolean |
B | byte |
C | char |
S | short |
I | int |
J | long |
F | float |
D | double |
V | void |
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:
has the following signature:
TestObject.unregister()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.unregisterAll()
,
RationalTestScript.getRegisteredTestObjects()
public TestObject findById(java.lang.String id)
id
- The id of the object to locate NULL
if one could not be located.NULL
is returned.SAPGuiTextTestObject to = SAPGuiSessionTestObject.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtHEADER-FBFOOTLINE")
SAPGuiTextTestObject to = SAPGuiSessionTestObject.findById("txtHEADER-FBFOOTLINE")
public void sendCommand(java.lang.String command)
command
- The command string to executepublic void createSession()
public void startTransaction(java.lang.String transaction)
transaction
- The SAP transactionpublic void endTransaction()
public java.lang.String getVKeyDescription(int vKey)
SendVKey
)
to a meaningful string value.
vKey
- the integer vKey public java.util.Hashtable getSessionInfo()
Client: The client selected on the login screen.
Codepage: The codepage specified in SAPlogon in the properties of the connection.
Flushes: The property flushes counts the number of flushes in the automation queue during server communication.
Group: The login group information is available only if the session belongs to a connection which was started using load balancing.
GuiCodepage: A list of codepages is available in table TCP00A of the SAP system. On a client running Microsoft Windows with codepage 1252 (Latin I) the property guiCodepage is 1160.
I18NMode: The I18N mode of SAP GUI is required for multi-byte character sets.
InterpretationTime: The interpretation time begins after the data have arrived from the server. It comprises the parsing of the data and distribution to the SAP GUI elements. The unit is milliseconds.
IsLowSpeedConnection: The property is True if the connection to which the session belongs runs with the low speed connection flag. This flag can be set on the advanced connection properties page of the SAPLogon dialog. The SAP GUI Scripting support is very limited for low speed connections, because information required to identify SAP GUI objects is not being sent.
Language: The language specified on the login screen.
MessageServer: The message server information is available only if the session belongs to a connection which was started using load balancing.
Program: The name of the source program that is currently being executed.
ResponseTime: This is the time that is spent on network communication from the moment data are sent to the server to the moment the server response arrives. The unit is milliseconds.
RoundTrips: Before SAP GUI sends data to the server it locks the user interface. In many cases it will not unlock the interface once data arrive from the server, but instead will send a new request to the server immediately. Controls in particular use this technology to load the data they need for visualization. The count of these token switches between SAP GUI and the server is the roundTrips property.
ScreenNumber: The number of the screen currently displayed.
ScriptingModeReadOnly: The read only mode can be enabled using an application server profile parameter. In this mode the state of SAP applications can not be changed through the Scripting API, which means: Properties can only be read, but not set Functions can only be called if they do not change the control’s state.
ScriptingModeRecordingDisabled: The recording disabled mode can be enabled using an application server profile parameter. In this mode SAP GUI Scripting does not fire any events. This implies that user interaction can not be recorded. However data can be read from SAP GUI and scripts can be used to run transactions.
SessionNumber: The number of the session is also displayed in SAP GUI on the statusbar.
SystemName: This is the name of the SAP system.
SystemNumber: The system number is set only if the session belongs to a connection that was started without load balancing, by specifying an application server.
SystemSessionId: All SAP GUI sessions of the same connection are represented on the server with the same SystemSessionId. Using SystemSessionId and SessionNumber, it is possible to find a matching SAP GUI session from an ABAP application.
Transaction: The transaction that is currently being executed.
User: The SAP name of the user logged into the system.
public TestObject findByPosition(int x, int y)
x
- the x coordy
- the y coord TestObject
located at the given point, or
NULL
if one does not exist.NULL
is returned
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |