简体   繁体   中英

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

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:

在此处输入图片说明

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")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM