Page 1 of 1

.//?[@innertext='xxxx'] is always found

Posted: Wed May 12, 2021 1:12 pm
by TimoL
If I use question mark, which should mean which ever tag, and some property, like innertext with some rubbish which does not exist in the AUT, both Ranorex and Spy claims the element is found.

If I use what ever tag instead of question mark, the element is not found (which is correct). Why the question mark works here incorrectly?

Re: .//?[@innertext='xxxx'] is always found

Posted: Wed May 12, 2021 2:20 pm
by odklizec
Hi,

Question mark does not mean “whichever” but “optional”! For “any” tag, use asterisk, like //*[@innertext=‘xxxx’]

Re: .//?[@innertext='xxxx'] is always found

Posted: Tue May 18, 2021 11:40 am
by TimoL
Thanks Odklizec! How simple mistake...

Re: .//?[@innertext='xxxx'] is always found

Posted: Tue May 18, 2021 1:22 pm
by odklizec
Hi,

You are welcome. Don't worry about this. This could happen to anyone ;) I just debugged one thing for half an hour, only to find how stupid mistake I did :D