|
IBM Rational Functional Tester Version 8.2.1 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.ClientTestObject
public class ClientTestObject
Field Summary |
---|
Fields inherited from class com.rational.test.ft.object.interfaces.TestObject |
---|
ignoreTheObjectState, ref |
Constructor Summary | |
---|---|
ClientTestObject()
|
|
ClientTestObject(RegisteredObjectReference ror)
|
|
ClientTestObject(SpyMappedTestObject mappedObject,
TestObject anchor)
|
|
ClientTestObject(SpyMappedTestObject mappedObject,
TestObject anchor,
long scriptCommandFlags)
|
Method Summary | |
---|---|
boolean |
exists()
Returns true if the object exists now, false otherwise. |
TestObject |
find()
Finds the object in the software under test and returns a reference to it. |
TestObject[] |
find(Subitem properties,
boolean mappableOnly)
Finds all candidates that match given search criteria starting at this TestObject . |
java.lang.Object |
findAndInvoke(Subitem properties,
java.lang.String methodName,
java.lang.String methodSignature,
java.lang.Object[] args,
boolean mappableOnly)
Finds a TestObject based on find(Subitem, boolean) and invokes
the supplied method on the TestObject (invoke(String, String, Object[]) ). |
java.lang.Object |
findAndInvokeProxy(Subitem properties,
java.lang.String methodName,
java.lang.String methodSignature,
java.lang.Object[] args,
boolean mappableOnly)
Finds a TestObject based on find(Subitem, boolean) and invokes
the supplied method on the TestObject's proxy (invoke(String, String, Object[]) ). |
java.lang.Object |
getProperty(java.lang.String propertyName)
Returns the value of the specified property. |
java.util.Hashtable |
getTestDataTypes()
Returns a Hashtable of data type descriptions of the verification
point data available with the associated 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. |
protected java.lang.Object |
invokeProxy(java.lang.String method,
java.lang.String methodSignature,
java.lang.Object[] args)
Invokes a method on the proxy for an object in the software under test. |
void |
unregister()
Unregisters a TestObject reference. |
void |
waitForExistence(double maximum_find_object_time,
double find_object_wait_between_retry)
Waits until an object exists. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClientTestObject()
public ClientTestObject(RegisteredObjectReference ror)
public ClientTestObject(SpyMappedTestObject mappedObject, TestObject anchor, long scriptCommandFlags)
public ClientTestObject(SpyMappedTestObject mappedObject, TestObject anchor)
Method Detail |
---|
public boolean exists()
true
if the object exists now, false
otherwise.
If the TestObject
contains a mapped reference and there are multiple
matching objects (that is, the recognition is ambiguous), exists
returns true
.
This method does not wait for the object to come into existence.
This method does not raise ambiguous recognition events or object-not-found
events.
exists
in class TestObject
ClientTestObject
public java.util.Hashtable getTestDataTypes()
Hashtable
of data type descriptions of the verification
point data available with the associated object in the software under test. The
Hashtable
keys are String
objects that are used as the verification point
type
in the associated test data. The type
is a
simple value that is different from other type values associated
with this object under test. The type
keys map to a verbose
description of the test data. This is reasonable for presentation to a
user.
getTestDataTypes
in class TestObject
Hashtable
of type
/description
pairs
used to describe the verification data available from this
proxy.TestObject.getTestData(String)
,
ITestData
public TestObject find()
find
in class TestObject
unregister()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.unregisterAll()
,
RationalTestScript.getRegisteredTestObjects()
public TestObject[] find(Subitem properties, boolean mappableOnly)
TestObject
.
Valid values for the property subitems are:
atProperty
- A name/value pair representing a TestObject
property.atChild
- Contains one or more properties that must be matched
against the direct child of the starting TestObject
.atDescendant
- Contains one or more properties that can be matched
against any child of the starting TestObject
.atList
- Used to specify a sequential list of properties to match against.
atList
valid subitems are atChild
, atDescendant
, and atProperty
.
The first list item is matched against to get a list of candidates,
and out of those candidates their descendants is matched against for the next
list item, and so on.
TestObject[] foundTOs ;
// Given Notepads outer window, this will find its text window.
foundTOs = Notepad_Form().find(atDescendant(".class", ".text")) ;
// This will find all the forms in the given browser, and return the forms
// direct children that are buttons with text "Submit"
foundTOs = Browser_htmlBrowser().find(atList(
atDescendant(".class", "Html.FORM"),
atChild(".class", "Html.INPUT.submit",
".value", "Submit"))) ;
// This will find all the forms in the given browser, and return all forms
// "INPUT" elements, of any type.
RegularExpression inputRE = new RegularExpression("*INPUT*", false) ;
foundTOs = Browser_htmlBrowser().find(atList(
atDescendant(".class", "Html.FORM"),
atChild(".class", inputRE))) ;
find
in class TestObject
properties
- The property set to match against.mappableOnly
- Whether to search all children or just mappable childrenunregister()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.unregisterAll()
,
RationalTestScript.getRegisteredTestObjects()
public java.lang.Object findAndInvoke(Subitem properties, java.lang.String methodName, java.lang.String methodSignature, java.lang.Object[] args, boolean mappableOnly)
TestObject
based on find(Subitem, boolean)
and invokes
the supplied method on the TestObject
(invoke(String, String, Object[])
).
The found TestObject
is automatically unregistered (unregister()
)
during the transaction.
If no candidates are found an ObjectNotFoundException
is thrown.
If more than one candidate is found an AmbiguousRecognitionException
is thrown.
If the specified method does not exist on the found TestObject
a
MethodNotFoundException
is thrown.
findAndInvoke
in class TestObject
properties
- The property set to match againstmethodName
- The method to invokemethodSignature
- The JNI signature of the method to invokeargs
- An array of arguments to pass to the invoked methodmappableOnly
- Boolean indicating whether only mappable children of the
TestObject
should be considered.
find(Subitem, boolean)
,
invoke(String, String, Object[])
public java.lang.Object findAndInvokeProxy(Subitem properties, java.lang.String methodName, java.lang.String methodSignature, java.lang.Object[] args, boolean mappableOnly)
TestObject
based on find(Subitem, boolean)
and invokes
the supplied method on the TestObject's
proxy (invoke(String, String, Object[])
).
The found TestObject
is automatically unregistered (unregister()
)
during the transaction.
If no candidates are found an ObjectNotFoundException
is thrown.
If more than one candidate is found an AmbiguousRecognitionException
is thrown.
If the specified method does not exist on the found TestObject
a
MethodNotFoundException
is thrown.
findAndInvokeProxy
in class TestObject
properties
- The property set to match againstmethodName
- The method to invokemethodSignature
- The JNI signature of the method to invokeargs
- An array of arguments to pass to the invoked methodmappableOnly
- Boolean indicating whether only mappable children of the
TestObject
should be considered.
find(Subitem, boolean)
,
invoke(String, String, Object[])
public void waitForExistence(double maximum_find_object_time, double find_object_wait_between_retry)
waitForExistence
in class TestObject
ObjectNotFoundException
AmbiguousRecognitionException
maximum_find_object_time
- the maximum amount of time (in seconds)
to wait while finding the objectfind_object_wait_between_retry
- the amount of time (in seconds)
to wait between attempts to find the objectClientTestObject
public void unregister()
TestObject
reference.
unregister
in class TestObject
RationalTestScript.unregister(Object[])
,
RationalTestScript.unregisterAll()
,
RationalTestScript.getRegisteredTestObjects()
public java.lang.Object invoke(java.lang.String method, java.lang.String methodSignature, java.lang.Object[] args)
TestObject
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.
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:
void myMethod(long n, String s, int[] arr)
has the following signature:
(JLjava.lang.String;[I)V
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 methodTestObject.unregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
protected java.lang.Object invokeProxy(java.lang.String method, java.lang.String methodSignature, java.lang.Object[] args)
TestObject
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.
invokeProxy
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 methodinvoke()
,
TestObject.unregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
public java.lang.Object getProperty(java.lang.String propertyName)
getProperty
registers the object in the software under test and returns a reference
to the object.
Registered object references are
released by calling one of the unregister methods.
If the property is not defined on the object, a
PropertyNotFoundException
is thrown.
getProperty
in class TestObject
propertyName
- the name of the propertyrational.test.ft.log.enhanced=false
.
In order to re-enable logging of this event, change the value of this property to true
. The default value of this property is true
.unregister()
,
RationalTestScript.unregisterAll()
,
RationalTestScript.unregister(Object[])
,
RationalTestScript.getRegisteredTestObjects()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |