element may exist, if it does use it
Posted: Fri May 19, 2017 9:06 pm
I'm sure there's an answer to this somewhere, but after searching for an hour I haven't found it (and feel like I'm running in circles).
In a nutshell I have a ranoreXpath that *may* have an element in it (it also may not).
If the element is in the path && matches a particular criteria then I want that path chosen, if it does not match that criteria then I want that path ignored.
here is the snip that does not work:
The problem is that I can still match @visible='False' because of the question mark. I can't make this a fixed element (no ?) because it may be a different earlier branch that is being followed (and so this element isn't even there).
I've also triedto no avail.
Is there a way for me to ensure that if an element is in the path with a particular value (visible='False') in this case it will be excluded from selection criteria?
thanks,
-marc
In a nutshell I have a ranoreXpath that *may* have an element in it (it also may not).
If the element is in the path && matches a particular criteria then I want that path chosen, if it does not match that criteria then I want that path ignored.
here is the snip that does not work:
Code: Select all
/element//element?[@visible='True' and @controlname='TabbedContainer_tabControl']//table
I've also tried
Code: Select all
element//element?[@visible='True' and @visible~'^((?!False).)*$' and @controlname='TabbedContainer_tabControl']//table
Is there a way for me to ensure that if an element is in the path with a particular value (visible='False') in this case it will be excluded from selection criteria?
thanks,
-marc