Adding a new TestObject

You can add a new TestObject when there are no TestObjects with the method that you want to expose for a control, available within the set of predefined TestObjects provided by HCL OneTest UI. For example, you can expose any button control as GuiTestObject() and operations such as click() and doubleClick() are defined as methods in it. You can create a new TestObject if you want to introduce a new method call such as myClick(), which is not defined in any of the existing TestObjects.

Before you begin

Note: Proxies are developed either in Java or in C#. However, you must implement TestObjects for proxies in both Java and C#, because they are just wrappers to proxies in both Java and Visual Basic .Net scripts. When you add a new custom TestObject, ensure that you define the Java implementation of the TestObject. This is required even if you use VS.NET IDE for creating functional test scripts.

About this task

To add a new TestObject:

Procedure

  1. Create the constructors for the TestObject.
    Note: Every TestObject must have five standard constructors. New methods that are defined follow these constructors.
  2. Define new canonical names for the TestObject in the customization file.

    You must specify two entries for every canonical name for both Java and .NET TestObjects in the customization file, because they are developed in both Java and .NET.

  3. Map the proxies to the newly created TestObject.
  4. Build the TestObject binary files.

    You can group all the Java TestObject binary files in a single JAR file and the .NET TestObjects in a single .NET assembly.

  5. Deploy the TestObject binary files by copying the files to the HCL OneTest UI customization directory, C:\ProgramData\HCL\HOTUI\customization.
  6. Restart HCL OneTest UI.

What to do next

After successfully developing and deploying the TestObject binary files, the Administrative properties of the newly recorded controls, for which you created new TestObjects show the new TestObject names under Test Object Class Name.