Finding controls by their children's properties
Posted: Thu Mar 23, 2017 5:39 pm
I'm attempting to write some xpath to efficiently find a dom control. The dom itself doesn't have unique properties, but one of the child elements does. I have the following xpath that finds it correctly:
/dom[@domain='stuff']//?[@tagname='candidate-home']//ancestor-or-self::dom
However, I remember seeing some syntax to shorten this. I don't remember exactly what the syntax was, but it looked something like
/dom[@domain='stuff' and ?[@tagname='candidate-home']]
Is that actually a thing, or am I completely making this up? I've tried that syntax (and similar) but ranorex spy doesn't like it.
/dom[@domain='stuff']//?[@tagname='candidate-home']//ancestor-or-self::dom
However, I remember seeing some syntax to shorten this. I don't remember exactly what the syntax was, but it looked something like
/dom[@domain='stuff' and ?[@tagname='candidate-home']]
Is that actually a thing, or am I completely making this up? I've tried that syntax (and similar) but ranorex spy doesn't like it.