XPath for finding both modal and in-application windows.

Ranorex Studio, Spy, Recorder, and Driver.
User avatar
odd
Posts: 17
Joined: Fri Mar 11, 2011 9:37 am

XPath for finding both modal and in-application windows.

Post by odd » Wed May 04, 2011 4:41 pm

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Wed May 04, 2011 10:12 pm

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

User avatar
odd
Posts: 17
Joined: Fri Mar 11, 2011 9:37 am

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

Post by odd » Fri May 06, 2011 1:26 pm

Thank you for answer.