Reputation: 53
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?
Upvotes: 2
Views: 14064
Reputation: 114695
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 WebTable
s 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
Upvotes: 3
Reputation: 15370
You can use ChildItem
method of WebTable
.
Set MyWebElement = Browser("CreationTime:=0").Page("micclass:=Page").Webtable("name=TableName").ChildItem(Row, Column, micclass, Index)
MyWebElement
is the element you wanted. You can access any methods/properties of WebElement
. For ex, to click,
MyWebElement.Click
Upvotes: 1