I am working with an interface that switches between displaying different div elements. Each div element has their children arranged differently, and when the switch happens, I need to access a specific child node of the newly displayed div. However, I find it frustrating that both the childNodes and children property only allow me to select children using item(index), which varies depending on the div.
In Protractor, I used webmanager.by(selector) to search for elements based on parameters other than index. Is there a similar method I can use to select the child node with data-relevant="true"? I am also questioning if using this attribute is the most effective way to specify in HTML which child node is relevant.
It's worth noting that this is an Angular application.