How to identify a Specific WebElement which is a child of WebTable in UFT

Saurabh Seth picture Saurabh Seth · Apr 20, 2015 · Viewed 12.6k times · Source

I have a WebTable, which has some WebElements. I want to verify the text of one of the WebElements and take action on it. Can you help, how to proceed on this?

Answer

Motti picture Motti · Apr 20, 2015

As Vinoth said if you know which row and column the element is in you can use ChildItem.

Typically UFT flattens the elements (so that a WebElement in a WebTable will appear as the WebTables sibling if both are added to the repository. However something that many people do not know is that if you manually put an element under the WebTable (or any other element) then UFT will look for it under the parent object.

This means that you can describe the nested element and UFT will only look under the table and not in the rest of the page.

Browser("B").Page("P").WebTable("T").WebElement("innertext:=.*bla.*").Click