Identifying an object based on its parent

In some cases, a TO may appear repeatedly on a window or page. A common example is images that are used as buttons in web applications. If a function is called to perform an action on such a TO, we may need to ensure that the correct object was passed. A powerful technique to achieve this is already outlined in the Identifying elements based on anchors recipe in Chapter 2, Testing Web Pages. In this recipe, we will see how to do it according to the object's parent (such as a Frame or WebTable, but can also be any WebElement), which is the container that holds our target TO.

How to do it...

Suppose that we have a reference to an OR TO and need to perform an operation or checkpoint using it and that we know ...

Get Advanced UFT 12 for Test Engineers Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.