I have a webtable which MIGHT have a weblink object in it's Row 2, Column 1 cell (also Index of this object is 0). If it indeed is a link I would like to click it else ignore it. Is there a way to identify the class of this object given that we know the row and column number.
Below was my initial code. However it doesn't work always when the webtable cell doesn't have a link to click
Set Table = Browser("Oracle PeopleSoft").Page("Request Payment Predictor").WebTable("Run Control ID").ChildItem(2, 1, "Link", 0)
Table.Click
I would like to know if there a way to find the class of the Object (in cell of a web table) so I can click on the Object only if it's a link Or in other words can we use GetRoProperty("Class Name")
on a WebTable Cell Object?
The
ChildItem
function returns a test object of the requested type if it exists, otherwise it returnsNothing
.So your code should look like this:
The object returned by
ChildItem
is a test object (if it's notNothing
) so you can use the regular test object methods on it.Please note that the object returned is not a table cell object, it's the object of the type you requested, this type may be
WebElement
which is considered the base class of all web objects. This means that you can useChildItem
with"WebElement"
and then see what actual type it is by getting itsmicClass
(which is what the Class Name is called internally).Pro tip: The indexes are 1 based, you can use the undocumented
Highlight
function in order to make sure you're working on the right object (obj.Highlight
).