Page 1 of 1

How to find a form by name with a wildcard?

Posted: Fri Feb 27, 2009 10:37 pm
by Ciege
To find a form by name I use

Code: Select all

Ranorex.Form HDForm = Host.Local.FindChild<Ranorex.Form>(WindowName);
Let’s say that a window I am looking for always has "123" in the title and a date/time stamp. I want to look for the window with a name of "123*".

How can I manipulate the code above to do that?

Thanks...

Posted: Mon Mar 02, 2009 1:49 pm
by Support Team
You can use regular expressions in RanorexPaths. Please, read the documentation for more info:
http://www.ranorex.com/support/user-gui ... html#c1791

In your example (a form which title starts with "123") the code should look like this:

Code: Select all

Ranorex.Form HDForm = Host.Local.FindSingle<Ranorex.Form>("form[@title~'^123.*']");
Regards,
Alex
Ranorex Support Team