Mapping proxies to TestObjects

You can extend a proxy so that HCL OneTest™ UI uses a different a TestObject to provide a suitable interface on the scripting side.

Before you begin

Note: HCL OneTest UI contains a set of TestObjects with predefined methods that you can reuse while creating new proxies. HCL OneTest UI defined TestObjects have canonical names that are associated with them. For the complete list of predefined TestObjects and their associated canonical names, see the com.rational.test.ft.domain.ProxyTestObject or Rational.Test.Ft.Domain.ProxyTestObject members. Canonical names are string names for fully qualified TestObject class names.

You can extend the proxy methods that are listed in Table 1:

Table 1. Extensible methods for mapping proxies to TestObjects
Java .Net
String getTestObjectClassName() String GetTestObjectClassName()

The GetTestObjectClassName() returns the canonical name of the TestObject that needs to be mapped for a proxy. The TestObject can be either a new or existing TestObject.

The following Java™ sample returns the canonical name of the TestObject as TOGGLEGUITESTOBJECT_CLASSNAME:

Example

import com.rational.test.ft.domain.*;

public class someProxy extends baseProxy
{
 .
 .
 public String  getTestObjectClassName()
 {
    return ProxyTestObject.TOGGLEGUITESTOBJECT_CLASSNAME; 
 }
 .
 .
}

The following .Net sample returns the canonical name of the TestObject as TOGGLEGUITESTOBJECT_CLASSNAME:

using Rational.Test.Ft.Domain;

public class AnyProxy:BaseProxy
{
     .
     .
     .
    public override String GetTestObjectClassName()
    {
        return ProxyTestObject.TOGGLEGUITESTOBJECT_CLASSNAME; 
    }
    .
    .
   
}

What to do next

After successfully developing and deploying this proxy code, the control that is being recorded is mapped to the new TestObject. You can verify this by looking at the TestObjectName property under Administrative properties of the TestObject.
Feedback