Role of a TestObject

TestObjects are wrapper classes to proxies for TestScripts. A control is exposed as a Java or C# object to TestScripts through TestObjects. TestObjects are implemented in both Java and C#, because Rational® Functional Tester supports using both Java and Visual Basic .Net as the test-script language. If you use Visual Basic .Net scripts, TestObjects that are implemented in C# are used. For Java scripts, TestObjects that are implemented using Java are used.

TestObjects forward method calls to the respective proxy using the InvokeProxy method, as shown in the following example. The method is actually implemented in the proxy.

public virtual void PerformClick()	{
InvokeProxy("performClick");
}

public void Click(Rational.Test.Ft.Script.Index subitem) {
InvokeProxyWithGuiDelay("click", "(L.script.Index;)", new System.Object[]{subitem});
}

In this example, the "PerformClick()" method of TestObject calls the performClick() method of the proxy. The proxy carries out the actual playback operation of performClick().