Described is the use of query identifiers that provide computer users a
method of "bookmarking" (uniquely identifying) any user interface (UI)
element in any UI framework. This is useful for testing programs,
assistive technologies, and teaching activities. The unique query element
identifier is identified for a target UI element to locate within a
hierarchy of UI elements. For example, the element's Name, ClassName,
Instance, AccessibleName, Role, ControlId and AutomationId may be used to
develop the unique query element identifier. From the query elements in
the hierarchy of UI elements, a query identifier is generated for the
target UI element. The query identifier includes the query element
identifier and possibly ancestor query element identifiers, with each
ancestor query element identifier corresponding to a higher-level
ancestor element relative to the target element in the hierarchy. The
query identifier may be used to locate the target element for testing
versions of application programs.