Identify controls by anchors

In Tricentis Tosca, you can use technical properties of controls to identify other controls. For example if you copy a textbox Label to the Textbox. In this case, Tosca copies the identification criteria from the anchor control to the selected control.

Textbox with label

  1. Scan the required test object by using Tosca XScan.

  2. In the Advanced View of Tosca XScan, click the Identify by button and select Anchor from the drop-down menu to open the Identify by Anchor window.

  3. Select the control which should be identified.

The system automatically searches for a possible anchor and picks a unique Anchor Control.

Alternatively, you can select an Anchor Control manually, e.g. if the system cannot find an Anchor Control.

To manually select an Anchor Control, use drag and drop to move the control whose identification criteria should be copied to the Anchor Control field. The control is shown in this field as soon as you release the mouse button.

Alternatively, you can click on the Select on Screen button in the Identify by Anchor window and select the control that should be used as Anchor Control from your application.

Identify by Anchor window

The Anchor Control Properties window shows the properties that were transferred along with the control.

Transferred properties are shown in the Anchor Control Properties window

Relative Algorithm

In this drop-down menu you can define the algorithm to be used to identifycontrols by an anchor control. The selection is made automatically.

Possible values:

  • Shortest Path: The system searches each tree level for the control to be identified, starting with the anchor control. The search starts directly beneath the control and goes from bottom to top to the root element.

  • Coordinate: The exact position of the control to be identified is searched by using coordinates.

  • Auto: If the Shortest Path algorithm wasunsuccessful, the system will switch to the Coordinate algorithm.

How to remove anchors

  1. Select the control used for identification in the Anchor Control window.

  2. Select the option Remove Anchor from the context menu.

Remove anchors