Declaration of Page Items

Once a page has been declared, you can add items to the configuration. When you declare an item, you:

  • Associate it with a component in the page capture (selection).

  • Set the item parameters.

  • Define the criteria that enable the software to recognize this item on the page.

Items are declared offline from the page captures. Even the validity of criteria can be tested offline. A final validation must be performed online on the running application.

Associate Items With Components in the Page Capture

To work on a page capture, select a page in the Project tree.

The page capture is then displayed.

Associate a Component With a New Item

To associate a component with a new item, right-click the component in the Screen display and select Associate to a New Item from the context menu or double-click the component. You can also do this in the Tree display, Subtree tool window, and Text tool window.

The item is then added to the page items in the Project tree and an internal link is established between this item and the component selected in the screen capture. The new item is created with default parameters.

Smart declaration automatically generates the right criteria to uniquely identify the component in the UI (user interface). Smart declaration works in most scenarios except when the recognition requires complex patterns. In this case, it is up to you to set the right criteria.

If the action is performed from the Text tool window, a criterion is added to the Text property. These parameters and criteria can be edited in the Item properties panel.

Associate an Existing Item With a Component

Associating an existing item with a component is necessary when:

  • Changing the component already associated with the item,

  • There is no component associated with it (the item was created before the capture).

To associate the existing item, select it in the Project tree, right-click the component in the Screen display, and click Associate to the selected Item.

You can also do this in the Tree display, Subtree tool window, and Text tool window .

The parameters and criteria of the existing item remain unchanged.

Quick-Add Criteria to an Item

Criteria can be added directly from the Captured Data tool window by double-clicking the property that requires a new criterion.

If the selected component is not yet associated with an item, a new item is created automatically. Otherwise, the associated item is automatically selected.

The criterion is set for this property, with its complete value and the default scan value for this property.

Item Definition

Once an item has been created, various elements can be set in order to define it:

  • The item parameters

  • The criteria used for item recognition

  • The technical events notified by the item

Selecting the item in the Project tree gives you access to the Item definition panel.

Set Item Parameters

The Parameters tool window lets you set the item parameters:

General Category

Name

Name of the entity used in scripts to control the item

Comment

Description of the entity

Folder

Used to organize items (see Project Tree). Useful when you have a large number of items.

Technical

Indicates that the page/item is technical (true) or functional (false). Technical pages/items are filtered in perspectives other than the Explorer.

Connector Category

Parameters specific to each technology

Technical Category

Connector

Name of the connector used to control the application (read-only)

Offlinepath

Path where page captures are stored (read-only)

Technology

Technology of the page (read-only)

A description of each parameter is available in the Help panel (2).

Set Item Tracked Events

The Track Events tool window lets you set the technical events for the item. The list of available technical events depends on the page technology. A description of each event is available in the Help panel.

Set Item Criteria

There are two methods used to specify item criteria, depending on the page technology:

  • The single component method, which involves setting criteria for the properties of the component to be recognized

  • The components pattern method, which involves setting criteria for a pattern of one or more components to be recognized, where one of these components is the component to be targeted

The single component method can be used with any technology available with Desktop Studio. The components pattern method is used with Web and UI Automation technologies only.

The Single Component Method

The Captured Data tool window shows the properties of the component that can be used as criteria. These properties are collected when the page is captured. This tool window is empty if the page was captured with Desktop Studio.

The properties captured depend on the page technology and connectors: Only the properties used by the connector are captured.

The Criteria tool window lets you edit the criteria for the item that will be used by the connector to recognize it at runtime.

For a complete description of this tool window, see Criteria Management.

Components Pattern Method

The components pattern method involves recognizing a set of related components (a pattern), rather than a single component. In this case, components are linked together by a parent-child relationship. One of these components is the target component and is addressed in the project. This method is useful when the target component has no (or insufficient) unique, distinguishing properties. It also lets you define a components pattern with just one component, which is equivalent to the single component method.

Example:

Suppose a Web page has several TABLE components. We want to target the TABLE component that has the column header Company.

We can define the following components pattern:

  • One component (the target component) that recognizes the TABLE component (1)

  • A child component that recognizes the TH component that has the Text property equal to Date (2).

Build the Components Pattern

  • First, create the item from the page capture

    The Subtree tool window (1) shows a part of the complete captured page tree. It is centered on the component associated with (which means targeted by) the item, letting you add components to the pattern to be recognized:

  • To add a component to the pattern, right-click the component in the Subtree tool window (1) and select Add as New Component in the Pattern from the context menu. The component is then added to the Criteria tool window (2).

  • To remove a component from the pattern, right-click the component in the Criteria tool window (2) and select Remove Component from the context menu.

Properties of the Components Pattern

Components pattern properties can be set in the Criteria tool window (2).

The parent-children relationship

When added, components are automatically set at the right position in the pattern. This position is determined by the relative positions of the associated components. Associated components must have a parent-child relationship. It is not possible to add a sibling component. The depth of the relationship between recognized components can be set with the Children checkbox. If it is checked, the component recognized must be a direct child of the component recognized as the parent in the pattern.

In the example above, if the TH component has the Children checkbox checked, the TABLE component target will not be recognized because the recognized TH component is not a direct child of the recognized TABLE component.

The Occurs Property

The Occurs property of a component can be used if we want to address a collection of components. This is mainly used to set this property on the target component, but it can be set on any upper component in the pattern.

The Target property

The Target property is used to change the target component of the pattern. The target component is highlighted in bold in the pattern tree.

The Component Criteria

  • To edit the criteria of a component in the pattern, select the component in the pattern tree (2). The associated component is automatically selected in the Captured Data tool window (2).

  • Component criteria can be managed the same way as with the single component method.

Declaration of Items on an HLLAPI Page

In HLLAPI, an item is defined by:

  • Its X and Y coordinates

  • Its CX width

  • Optionally, if it is a MustExist label, its TEXT.

Declaration of items with HLLAPI is a little different from declaration with other technologies. An HLLAPI page capture doesn’t contain components, but only the text of the screen. This means that in order to declare a new item, you have to select the relevant part of the text instead of the component. After selecting the text, right-clicking the selection gives you several options:

  • Associate with new item: Create a new item with the X, Y, CX value of the selection.

  • Associate with new MustExist Label: Create a new MustExist item with the X, Y, CX, and TEXT values of the selection.

  • Associate with the selected item: Update the selected item with the X, Y, CX value of the selection.

Item Recognition

A soon as an item has at least one criterion, Desktop Studio attempts to recognize it. When an item is selected in the Project tree, its associated element (if any) is bordered by a blue rectangle. As a result, its recognized component(s), if any, is bordered by:

  • A green rectangle if it matches the associated one. As the two rectangles match, only one green rectangle is visible:

  • A red rectangle if it does not match. As the two components do not match, two rectangles, one blue AND one red, are visible:

Using the Recognition Tool Window

The Recognition tool window helps you to investigate cases where no components are recognized or where the recognized component is not visible.

For a more detailed description of item recognition, see About the Recognition Mechanism.

Choose the Current Capture for Recognition

When several captures have been created for a page, you can manually choose which capture is used for recognition by selecting the corresponding tab (1, 2, 3, and so on) from the capture selector.

When you select an item in the Project tree, the current capture is automatically set to the one where the item was associated with a UI component..

This behavior can be disabled by locking the current capture using the button in the Capture toolbar.