简体   繁体   中英

Object identification and replay in UFT

If suppose there two or more controls(eg. Buttons) with exactly same properties on a screen and while recording user actions if one of the controls was clicked, how can the appropriate control be identified and replay back the same click by overcoming the ambiguity of that control?

Scenario : Two 'cancel' buttons without an automation id or any useful assistive properties and let's say their hierarchy(ancestors) are same.

Replay script is being executed in UFT .

If UFT creates the objects, either via Record or by adding the object to repository, it will automatically add an ordinal identifier . This is a numeric value that selects the controls from the set of controls that match the (rest of the) description. The ordinal is usually based on the placement of the control (starting on the top left) and may not be the most robust way to identify the control.

It's probably better to use Visual Relations Identifier (VRI) which allows describing the control in relation to another control. This is similar to how a human would describe the button, eg "The cancel button to the left of the 'are you sure' text".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM