Object recognition with the Web Accessibility toolkit

The Web Accessibility toolkit is loaded by default when loading UFT's Web support. This toolkit enables you to work with Web objects that have defined the role property in the HTML code of the object.

For details on this property and its implementation in Web pages and applications, see http://www.w3.org/TR/wai-aria/roles.

This toolkit enables UFT to correctly map objects in your application by identifying the value of the role property and then creating a test object accordingly. For example, if you have an object that with this structure:

<ul role="menubar">
 
 <!-- Rule 2A: "File" label via aria-labelledby -->
  <li role="menuitem" aria-haspopup="true" aria-labelledby="fileLabel"><span id="fileLabel">File</span>
    <ul role="menu">

      <!-- Rule 2C: "New" label via Namefrom:contents -->
      <li role="menuitem">New</li>
      <li role="menuitem">Open…</li>
      …
    </ul>
  </li>
  …
</ul>

UFT reads the role= attribute and creates (in this case) a WebMenu object, according to the role:

Role UFT Test Object
button

WebButton

checkbox WebCheckBox
link Link
list (with item role listitem) WebList
listbox

WebList

tablist WebTabStrip
menubar
menu

WebMenu

radio WebRadioGroup
tree WebTree

This toolkit is enabled by default when starting UFT, unless you have the YahooUI Web 2.0 toolkit or the SAP Solutions Add-in loaded. In addition the Web Accessibiliy toolkit objects (WebTabStrip, WebTree, or WebMenu, or other standard Web objects using the "role=" property) are not supported on Edge browsers.

If you want to manually activate or turn off this toolkit's support, you can use the Setting object in your test or component steps:

To activate the toolkit:

Setting.Packages.WebPackage("EnableWebRoleBasedKit") = 1

To turn off the toolkit support:

Setting.Packages.WebPackage("EnableWebRoleBasedKit") = 0