TestObjects

TestObjects are the script-side interfaces for proxies and application under test (AUT) controls. A TestObject is a connection point between the test script and a ProxyObject that connects to the real object in the AUT. During recording, statements are recorded and objects are added to the Object Map. The script uses the information from the Object Map to construct and find TestObjects.

For example, if you record Button().click(), the Button() method finds an object that is based on the mapped properties and binds the TestObject to an object in the AUT. This binding is required to query information from the actual object, such as asking the button directly where it is currently located on the screen. Then the click() method is executed and the TestObject is unregistered, which releases the connection to the actual object in the AUT. Using TestObjects from the map in this manner manages the lifetime of the object automatically.

TestObjects are exposed to the scripting side based on which proxy it is mapped to. You must specify the proxy and TestObject mapping so that when a control is exposed to the script, the control is exposed as the TestObject that is specified in the mapping. You can create the mapping between a proxy and TestObject by overriding getTestObjectClassName() method on any proxy. If you want to change the TestObject that is mapped to a proxy, override the getTestObejctClassName() API to return the canonical name specified in the customization file.