Forum Discussion

ehaartmans's avatar
ehaartmans
Occasional Contributor
12 years ago

Using regular expressions in namemapping

Hi there,



I have a namemapping for an application/main screen which has a dynamic title bar.

I use the AWTComponentAccessibleName property in the namemapping.

The layout of title bar is always something like this:

ABC somename: username

After username there are a lot of spaces.

somename and username can be different in the same application

I cannot use a wildcard like this: ABC *: * because other titles in the same title bar have a title like this:

ABC somename: username                Path: AB

Again there are a lot spaces after AB

How can I define the main screen in the namemapping with regular expressions?

Or doesn't namemapping support regular expressions other than *?

  • Hi Erik,


     


    It's possible to use only the * and ? wildcards in string property values (the asterisk (*) matches zero or more characters, and the question mark (?) matches any single character). If you have many forms, check the value of the Visible or VisibleOnScreen property - it may be True only in one form that you need to use.


    Also, you can try using the Required Children feature - it allows mapping the object based on its children.