How to get the parent element from child element?

Viewed 775

I am trying to get the parent element of the object.

  obj.GetROProperty("parent").GetROProperty("innertext")

But I am getting whole html element instead of div block.

1 Answers

UFT flattens the DOM so that (by default) all HTML elements are children of the document (Page or Frame). If you want the actual DOM parent you can use the .Object property

MsgBox obj.Object.parentElement.textContent
Related