简体   繁体   English

UFT如何根据Web元素查找Web表格

[英]UFT How to find a web table depending on web element

I want to find the web table below the web element 我想在Web元素下面找到Web表

For example in that image Parity Relationship: Instant Dry Milk is the Web Element (Just the web element - Browser-page-web element) 例如,在该图像中, 奇偶校验关系:速溶干奶是Web元素(只是Web元素-Browser-page-web元素)

I want to find the table name below that web element 我想在该Web元素下找到表名

I would simply use this XPath as part of object description to identify the table. 我只是将此XPath作为对象描述的一部分来标识表。

.//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. 获取表后,使用GetROProperty检索name属性值。

I have created sample HTML page and here is the screenshot of working XPath: 我已经创建了示例HTML页面,这是工作XPath的屏幕截图:

在此处输入图片说明

UFT allows you to nest objects and will then search for the nested object only under the nesting object. UFT允许您嵌套对象,然后仅在嵌套对象下搜索嵌套对象。

You can see more details in this blog post (search for "WebElement(s)" ). 您可以在此博客文章中看到更多详细信息(搜索“ WebElement(s)” )。

So you can have something like this: 所以你可以有这样的事情:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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