Page 1 of 1

How to query for a Form using substring with Ranorex 2.1.2

Posted: Wed Aug 05, 2009 12:12 pm
by cancerion
Hi,

I am using Ranorex 2.1.2 version
I want to know how can we search a form, control and element on basis of substring.

I know about Ranorex 1.5, I can use ‘SearchMatchMode’.

Thanks,
Sachin

Re: How to query for a Form using substring with Ranorex 2.1.2

Posted: Wed Aug 05, 2009 1:25 pm
by Support Team
Hi cancerion,
use the RxPath regular expression functionality to search for substrings like:
// e.g. Form Title: Documentation
string subStr = "menta";
string path = "/form[@title~'"+ subStr +"']";
Element elem = Host.Local.FindSingle(new RxPath(path));
Please read the Ranorex User Guide topic on regular expressions in RxPaths:
http://www.ranorex.com/support/user-gui ... html#c1791
Additional info on regular expressions can be found on MSDN:
http://msdn.microsoft.com/en-us/library/az24scfc.aspx

Regards,
Christian
Support Team

Re: How to query for a Form using substring with Ranorex 2.1.2

Posted: Thu Aug 06, 2009 12:44 pm
by cancerion
It works for me.

Thanks,