Using the Index property
The index property can sometimes be a useful for uniquely identifying an object. The index description property identifies an object based on the order in which it appears within the source code, where the first occurrence is 0.
Index property values are object-specific. Thus, if you use an index value of 3 to describe a WebEdit test object, UFT searches for the fourth WebEdit object in the page.
If you use an index value of 3 to describe a WebElement object, however, UFT searches for the fourth Web object on the page regardless of the type, because the WebElement object applies to all Web objects.
For example, suppose you have a page with the following objects:
An image with the name Apple
An image with the name UserName
A WebEdit object with the name UserName
An image with the name Password
A WebEdit object with the name Password
The description below refers to the third item in the list above, which is the first WebEdit object on the page with the name UserName:
The following description, however, refers to the second item in the list above, which is the first object of any type (WebElement) with the name UserName:
Note: If there is only one object, using index=0 does not retrieve it. You should not include the index property in the object description.