LeanFT 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 LeanFT to identify the object in your application.

Create test object definitions with LeanFT tools

Create test object definitions automatically using the tools that come with LeanFT:

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 (OIC).

Application Model

A user interface provided by the LeanFT plugin 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 LeanFT runtime engine. The LeanFT 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 LeanFT 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 LeanFT runtime engine settings.

Back to top

Create test object definitions using the SDK libraries

You can use the LeanFT 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. Before you learn how to code test object descriptions manually, make sure you understand the logic behind them: 

  • 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. LeanFT searches for objects by identifying the object that matches the test object description within its parent object.

Examples

AUT technology Object LeanFT Namespace/Package LeanFT Interface LeanFT 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: