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

XPath for finding both modal and in-application windows.

Ranorex Spy, Recorder, and Studio.

XPath for finding both modal and in-application windows.

Postby odd » Wed May 04, 2011 5: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
odd
 
Posts: 17
Joined: Fri Mar 11, 2011 10:37 am

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

Postby Support Team » Wed May 04, 2011 11: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
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

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

Postby odd » Fri May 06, 2011 2:26 pm

Thank you for answer.
User avatar
odd
 
Posts: 17
Joined: Fri Mar 11, 2011 10:37 am


Return to Automation Tools

Who is online

Users browsing this forum: No registered users and 0 guests