Changing the role of a control

The role of a control determines which icon is displayed in the Object Map for a TestObject. You can do this by extending the getRole() method and returning one of the HCL OneTest UI predefined role values.

Before you begin

You can extend the methods listed in Extensible methods for changing roles :
Table 1. Extensible methods for changing roles
Java .Net
String getRole() string GetRole()

The following Java sample changes the icon for the TestObject to a slider icon:

Example

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

public class someProxy extends baseProxy
{
 .
 .
 public String getRole()
 {
     return TestObjectRole.ROLE_SLIDER;
 }

}

The following .Net sample changes the icon for the TestObject to a slider icon:

using Rational.Test.Ft.Domain;

public class AnyProxy:BaseProxy
{
     .
     .
     public override string GetRole()
     {
           return TestObjectRole.ROLE_SLIDER;
     }
}

What to do next

After successfully developing and deploying this proxy code, the icon for the TestObject in the Object map changes to a slider icon.