Ramesh
Ramesh

Reputation: 55

UFT How to find a web table depending on web element

I want to find the web table below the web element

For example in that image Parity Relationship: Instant Dry Milk is the Web Element (Just the web element - Browser-page-web element)

I want to find the table name below that web element

Upvotes: 1

Views: 1746

Answers (2)

Motti
Motti

Reputation: 114695

UFT allows you to nest objects and will then search for the nested object only under the nesting object.

You can see more details in this blog post (search for "WebElement(s)").

So you can have something like this:

Browser("B").Page("P").WebElement("Parity Relationship: Instant Dry Milk").WebTable("T")

Upvotes: 1

ManishChristian
ManishChristian

Reputation: 3784

I would simply use this XPath as part of object description to identify the table.

.//legend[contains(.,'Parity Relationship:') and contains(.,'Instant Dry Milk')]/following-sibling::table

Once you get the table, use GetROProperty to retrieve the name property value.

I have created sample HTML page and here is the screenshot of working XPath:

enter image description here

Upvotes: 1

Related Questions