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). HCL OneTest™ UI 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 HCL OneTest™ UI. 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 Extensible methods for specifying recognition property to
specify recognition properties and weight for a control.Note: 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 Extensible methods for specifying hierarchy to
specify the hierarchy of a control. Note: 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 Extensible methods for changing administrative characteristics to change the administrative characteristics of a control, for example icons or descriptive names.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
HCL OneTest™ UI 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 Extensible methods for recording 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 Extensible methods for playback to find the screen rectangle or point for a SubItems.Note: Typically, you do not need to extend these
methods unless you introduce new SubItems.
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 Extensible
methods for adding datatypes 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 Extensible
methods for adding properties 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 Extensible methods for data driving to specify the method that should be used 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 Extensible methods for reflection support for reflection support.Java | .Net |
---|---|
getMethods() | GetMethods() |
invoke() | Invoke() |
getNonValueProperties() |