Web object identifier types

UFT One uses a number of different object identifier types.

CSS

CSS (Cascading Style Sheet) is a language used to define formatting of elements in HTML pages. You can define a CSS value for a test object to help identify a Web object in your application based on its CSS definition.

UFT One uses CSS identifiers only when identifying objects and not when learning objects. Therefore, they are not available from the Object Spy dialog box or the Object Identification dialog box.

Back to top

User-defined XPath

XPath (XML Path) is a language used to define the structure of elements in XML documents. You can define an XPath to help identify a Web object in your application based on its location in the hierarchy of elements in the Web page. Because of the flexible nature of the language, you can define the XPath according to the unique way your Web page is structured.

UFT One uses XPath identifiers only when identifying objects and not when learning objects. Therefore, they are not available from the Object Spy dialog box or the Object Identification dialog box.

Back to top

Automatic XPath

You can instruct UFT One to automatically generate and store an XPath value when learning Web test objects. During the run session, if the automatically learned XPath for a particular object results in multiple matches or no matches, the learned XPath is ignored. Additionally, if you have added a user-defined XPath or CSS to a test object description, then the automatically learned XPath is ignored.

Automatic XPath is a UFT One-generated property, and therefore it is not available from the Object Spy dialog box , the Add/Remove Properties dialog box, or the Object Identification dialog box.

Back to top

Attribute/* Notation

You can use the attribute/* notation to access custom native properties of Web-based objects or events associated with Web-based objects. You can then use these properties or events to identify such objects by adding the notation to the object's description properties using the Object Identification dialog box, or by using programmatic descriptions.

Suppose a Web page has the same company logo image in two places on the page:

<IMG src="logo.gif" LogoID="122"> 
<IMG src="logo.gif" LogoID="123"> 

You could identify the image that you want to click by adding the attribute/LogoID notation to the object's description properties and using a programmatic description to identify the object:

Browser("Advantage Shopping").Page("Advantage Shopping").Image("src:=logo.gif","attribute/LogoID:=123").Click 68, 12

Back to top

See also: