ProxyObject hierarchy

While developing new proxies by extending existing proxies for any domain, it is important to understand the existing proxies and the hierarchies, so that you extend the right proxy.

For more information on methods and properties of proxy classes, see Proxy API reference.


Identifying the control under test

The first task for a functional testing tool is to identify the control under test and represent it in the application under test (AUT). Functional Tester identifies that a control is using recognition properties and the hierarchy, and represents it in the TestObject Map. Recognition properties and hierarchy might vary for different controls. The proxy developed for a control provides this information to Functional Tester. While developing new proxies you are going to inherit the base proxies in each domain. Usually you will not override these methods, because they are already implemented in the base proxies.

Recognition properties

You can use the methods that are listed in Table 1 to specify recognition properties and weight for a control.

You can also specify recognition properties and weight using the Object Library.


Table 1. Extensible methods for specifying recognition property

Java .Net
Hashtable getRecognitionProperties() Hashtable GetRecognitionProperties()
int getRecognitionPropertyWeight(String propertyName) int GetRecognitionPropertyWeight(String propertyName)

Hierarchy

You can use the methods that are listed in Table 2 to specify the hierarchy of a control.

Typically, these methods are implemented in the base proxy classes and you may not need to extend.


Table 2. Extensible methods for specifying hierarchy

Java .Net
getParent() GetParent()
getTopParent() GetTopParent()
getChildren() GetChildren()
Object getChildAtPoint(Point pt) Object GetChildAtPoint(Point pt)
getOwner() GetOwner()
getOwnedObjects() GetOwnedObjects()


Defining

You can use the methods that are listed in Table 3 to change the administrative characteristics of a control, for example icons or descriptive names.


Table 3. Extensible methods for changing administrative characteristics

Java .Net
String getTestObjectClassName() String GetTestObjectClassName()
String getDescriptiveName() String GetDescriptiveName()
String getUniqueId() String GetUniqueId()
boolean shouldBeMapped() bool ShouldBeMapped()
String getRole() String GetRole()
String getObjectClassName() String GetObjectClassName()


Recording

Functional Tester records the user actions performed on a control when the recorder is on. These user actions can be grouped as mouse interactions and keyboard interactions. You can use the methods that are listed in Table 4 for recording.


Table 4. Extensible methods for recording

Java .Net
void processMouseEvent(IMouseActionInfo action) void ProcessMouseEvent(IMouseActionInfo action)
void processPreDownMouseEvent(IMouseActionInfo action) void ProcessPreDownMouseEvent(IMouseActionInfo action)
void processPreUpMouseEvent(IMouseActionInfo action) void ProcessPreUpMouseEvent(IMouseActionInfo action)
void processPostUpMouseEvent(IMouseActionInfo action) void ProcessPostUpMouseEvent(IMouseActionInfo action)
void processHoverMouseEvent(IMouseActionInfo action) void ProcessHoverMouseEvent(IMouseActionInfo action)
getScriptCommandFlags() GetScriptCommandFlags()
Vector getSubItems() ArrayList GetActionArgs(Point pt)
Rectangle getRectangle(SubItem) SubItem FindSubItem(Point pt)


Playback

You can use the methods that are listed in Table 5 to find the screen rectangle or point for a SubItems.

Typically, you do not need to extend these methods unless you introduce new SubItems.


Table 5. Extensible methods for playback

Java .Net
Rectangle getScreenRectangle(SubItem) Point GetPointForSubItem(SubItem)


Verification points

You can add more datatypes and properties to a control.

Data verification

You can use the methods that are listed in Table 6 to add more datatypes to a control.


Table 6. Extensible methods for adding datatypes

Java .Net
Hashtable getTestDataTypes() Hashtable GetTestDataTypes()
ITestData getTestData(String) ITestData GetTestData(string testDataType)

Property verification

You can use the methods that are listed in Table 7 to add more properties to a control.


Table 7. Extensible methods for adding properties

Java .Net
Hashtable gerProperties() Hashtable GerProperties()
object getProperty(String) object GetProperty(string)


Data driving

You can use the methods that are listed in Table 8 to specify the method that should be used for data driving.


Table 8. Extensible methods for data driving

Java .Net
MethodSpecification getDataDrivableCommand MethodSpecification GetDataDrivableCommand


Reflection Support

You can use the reflection support that Java and .Net provide from the test script. With APIs such as getMethods() and Invoke(), you can access information about methods on the underlying object to use in remote invocation. This information includes method name and signature. You can use the methods that are listed in Table 9 for reflection support.


Table 9. Extensible methods for reflection support

Java .Net
getMethods() GetMethods()
invoke() Invoke()
getNonValueProperties()  
The getNonValueProperties() method returns the properties that are not supported because the value is a reference to an object that can not be serialized across process boundaries. These properties can still be accessed using the getProperty() methods. If such a property is returned to the test script, it is returned as a TestObject containing a reference to the object in the AUT. The test script must call the TestObject method unregister() to release the object.