Forum Discussion
I had to do some research, since you are trying to access non native objects, i.e. objects that don't appear in the Object Browser.
I've written a small program, then spent ages trying to figure out why parentElement.children was only returning one object, which just had a property value of length!
As it's a collection of child elements, I need to call the method item i.e. parentElement.children.item(i) which then returns each of the child elements. This prints out the following
Which matches the HTML code
Are you able to do something similar, so that it retrieves mat-chip-row's? You might have to use a different property other than tagName
Thanks for the investigation! Yes, this approach kind of works. I can retrieve the mat-chip-rows this way. The problem is, I can't do anything with them :) They can't be clicked or used as a reference for any of the Find functions (to find certain element in them). Getting the same "xxx is not a function" error.
In a meantime, I tried slightly different approach using FindElementByXPath using aliasItem as a reference. But to my great surprise, even this approach does not work. It simply does not find the aliasItem's ancestor element, even though the same xpath works fine in chrome dev. mode.
var findParent = aliasItem.FindElementByXPath("./ancestor::div[contains(@class,'w3-row')]")
- rraghvani6 months ago
Champion Level 3
JavaScript in TestComplete is powered by V8 engine v5.8, and Chrome DevTools will be something like V8 v13.7.152.17.
Since you are working with non standard elements, you may have to implement your own "Find", "Click" etc methods. But before doing that, read through Using Custom Attributes of Web Objects? Refer to this Support for Web Controls