Test objects

Test objects represent the UI elements in your application.

Each test object is comprised of a unique property-value set that, together with its parent object hierarchy, enables OpenText Functional Testing for Developers to identify the object in your application. After you create a testing project (see Create a testing project or module), define test objects to use in your test.

Create test object definitions using the UI

Create test object definitions automatically using these built in tools:

Object Identification Center (OIC)
  • Identifies objects in your application and captures their current property values.
  • Provides a recommended set of properties and values that are expected to uniquely identify the object.
  • Enables you to edit the recommended descriptions to fit your needs.

The OIC provides several options for using the captured or edited information to create the test objects you need.

For details, see Object Identification Center.

Application Model

A user interface in your IDE that enables you to define and maintain a set of test objects.

You can use these test objects in multiple tests without the need to define them programmatically each time.

After you create an application model, you can use the corresponding class in your tests to access its test objects with full IntelliSense.

For details, see Application models.

When you run your test, lines of code that create test objects do not result in any communication with the runtime engine. The runtime engine only processes steps that use methods or properties to interact with the objects in your application. At that point, the test object is passed to the runtime engine.

If the runtime engine cannot find an object in your application that matches the description in your test object, it waits until the object appears or until the object synchronization timeout (default 20 seconds) elapses.

Note: You can change the object synchronization timeout in the Engine tab of the Settings dialog box. For details, see Customize the runtime engine settings.

Back to top

Create test object definitions using the SDK libraries

You can use the SDK libraries to manually define test objects based on the technology, object interface, and a set of properties and values that uniquely describe the object in your application. In this section, you learn the logic behind test object descriptions. After you learn the logic, you can code test object descriptions manually in your tests, as described in Add steps to your tests

  • Each technology has its own namespace or package with the types of objects that you use for testing applications based on that technology. For example, to test Web applications use:

    C# the HP.LFT.SDK.Web namespace
    Java the com.hp.lft.sdk.web package
    JavaScript the LFT.Web package
  • Each namespace or package contains a set of interfaces that represent the types of objects you want to test in your application.

  • Each test object interface has a variety of methods and properties you can use to interact with an object in your application.

  • Each interface has a corresponding <TestObject>Description class that enables you to create a unique object definition using sets of identification properties and values. (In JavaScript, the <TestObject> classes define the description properties.)

  • The base interface for all test objects is:

    C# ITestObject
    Java TestObject
    JavaScript

    TestObjectBase

    All Description classes inherit from the interface:

    C# IDescription
    Java Description
    JavaScript

    DescriptionBase

  • Each technology namespace or package is set up as a hierarchy of objects. OpenText Functional Testing for Developers searches for objects by identifying the object that matches the test object description within its parent object.

Examples

AUT technology Object Namespace/Package Interface Description Class
Web link

C#: HP.LFT.SDK.Web

Java: com.hp.lft.sdk.web

JS: LFT.Web

C#: ILink

Java: Link

JS: LinkTO

C#: LinkDescription

Java: LinkDescription

JS: Link

Standard button

C#: HP.LFT.SDK.StdWin

Java: com.hp.lft.sdk.stdwin

C#: IButton

Java: Button

C#: ButtonDescription

Java: ButtonDescription

.NET Windows Forms list view

C#: HP.LFT.SDK.DotNet.WinForms

Java: com.hp.lft.sdk.dotnet.winforms

C#: IListView

Java: ListView

C#: ListViewDescription

Java: ListViewDescription

.NET WPF radio button

C#: HP.LFT.SDK.DotNet.WPF

Java: com.hp.lft.sdk.dotnet.wpf

C#: IRadioButton

Java: RadioButton

C#:  RadioButtonDescription

Java: RadioButtonDescription

Back to top

See also: