Page 1 of 1

XPath for finding both modal and in-application windows.

Posted: Wed May 04, 2011 4:41 pm
by odd
Our application have MDIClient area, where the windows are placed by default, so the XPath will be like:

Code: Select all

/application/mdi-client/form
But, sometimes those windows are modal ant thier XPath is like:

Code: Select all

/form
I can find them both by using "/.//form" but its takes too much time. Is there a way to find them faster?
Have been trying XPath "/form | /application/mdi-client/form", but it seems or operator does not work.

P.S. Sorry for my english.

Re: XPath for finding both modal and in-application windows.

Posted: Wed May 04, 2011 10:12 pm
by Support Team
Hello,

alternative paths for one element is not possible. You need to use a path that works for both and that is only the one you already mentioned (/.//form). Else you need to write code and there you can try to find one path and if that fails you can try to find the other path. Use TryFindSingle().

Regards,
Roland
Ranorex Support Team

Re: XPath for finding both modal and in-application windows.

Posted: Fri May 06, 2011 1:26 pm
by odd
Thank you for answer.