<< Click to Display Table of Contents >> Navigation: 2. Components > 3. System-Variable and Specialfolders > 3.2 Standard-Search Pattern |
MiniRobotLanguage (MRL)
Standard Search Pattern
Intention
Generally spoken, its mostly never needed to use the whole string for a text search. In most cases and with nearly all commands, a unique substring is all you need to describe an element.
Additionally you can use search patterns to describe elements. These patterns can be used in most commands, where you search for Text. Using the patterns, you can make your scripts recognize controls from multiple languages.
For example, when you open a WEB-Site and you want to check if the page is really available, you could use the following vommand:
' Wait 15 seconds until whether the term "Description" or
' the term "Media not visible" appears.
SAO.rnw|42|Description&OR:Media not visible|15
Parameter Explanation
Search Pattern |
Shortform |
Example |
{&DOCAPS:} |
{&00:} |
{&DOCAPS:ExPE} |
{&OR:} |
{&01:} |
{Text1&OR:Text2} |
{&XOR:} |
{&02:} |
{Text1&XOR:Text2} |
{&AND:} |
{&03:} |
{Text1&AND:Text2} |
{&ANDTHEN:} |
{&04:} |
{Text1&ANDTHEN:Text2} |
{&FUZZY:} |
{&05:} |
{{Text1}&FUZZY:[value]} |
{&TOLERANT:} |
{&06:} |
{{Text1}&TOLERANT:[value]} |
{&NOT:} |
{&07:} |
{&NOT:{Text1}} |
{&EXACT:} |
{&08:} |
{&EXACT:Text1} |
{&NOTEXT:} |
{&09:} |
{&NOTEXT:} |
{&WILDC:} |
{&0c:} |
{&WILDC:Hallo??.*} |
{&t:} |
|
|
{&f:} |
|
|
{&DOCAPS:} = Activate Case-Sensitive
Normally all search patterns are not case sensitive. If you need case sensitivity, you can activate, the {&DOCAPS:}.
Text is: „Andreas is a human“.
Searching {&DOCAPS:andreas} will not find the text.
Searching {&DOCAPS:Andreas} will find the text.
{&OR:} = OR
To perform a logical 'OR' of two options.
If either are true, then the result is true, otherwise it is false.
This is most often used to accept buttons in different languages.
Example:
AFT.{yes&OR:ja&OR:Oui}
will find any such element no matter if its english, german or french. There is no limit on how many values are used.
{&XOR:} = XOR
To perform a logical 'OR' of two values.
Only one can be true to get a true result. When both are true, the “XOR” result is false.
{&AND:} = AND
All the Words (conditions) must be true.
{&ANDTHEN:}
The Words must be in sequence one after the other with any number of chars between.
{&FUZZY:}
The Value must be given in numbers. 0 ... 100. It enables the found string to be slightly different from the original source. {&FUZZY:} calculates the "Edit-Distance" which tells how many wrong key-press would lead to this result.
For example:
If your window has the Title:
"Walkenhorsts Letter.doc - Microsoft Word"
and you are using Matchstring: "{Microsaft&FUZZY:1}" then the result is true, because "Microsaft" is matching by 1 wrong character to "Microsoft".
{&TOLERANT:}
The Value must be given in 0% to 100%. It enables the found string to be slightly different from the original source. It uses a percentage Scale (0-100%). It usese percentage in different to Fuzzy.
{&NOT:}
The negotiation is true.
For example: The white light is not blue = TRUE
{&EXACT:}
When an expression should be exact the same you are looking for.
It is by default not case-sensitive.
For that you need to apply {&DOCAPS:} as well if needed.
{&EXACT:} will match the text only to true, if the text is equal.
This is important (for example) if you want to find a window "C:\Programme" while there is another one "C:\Programme\something".
Without {&EXACT:} you could match the wrong one.
{&NOTEXT:}
When you are looking for a window it has normally a name.
Some windows dont have names, so u can test it in your search by using the “&NOTEXT” pattern.
{&DOCAPS:&EXACT:Hallo&OR:{¬ext:}}
{&WILDC:}
This arconym stands for “wildcard” and there are some symbols for different comparings between a source and a target string.
These are the expression_pattern:
? Use this if you don`t know any single character (all but no digit)
* Use this if you don`t know any characters, it can be zero or more.
# Use this if you don`t know any single digit (0-9)
[charlist] For complex search algorythem. Any single character in 'charlist'
[!charlist] Any single character not in 'charlist'
{&WILDC:Andrea*M[üä]ller*}" match "Andreas Müller
{&t:}
Use this to tell „true“ to your command, because its always true.
{&f:}
Use this to tell „false“ to your command, because its always false.
Important: Standard-Search Pattern-terms must be written in UPPERCASE letters. Like:
&WILDC:
This i wrong:
&wildc:
This will also not work:
&WildC:
These patterns will only be recognized if they are written in big letters (uppercase).
Example:
{&DOCAPS:TheoGottwald&ANDTHEN:Internet}&OR:{&EXACT:Explorer}}
{&WILDC:Andrea*}" match "Andreas Müller
SCI.{&DOCAPS:ExPE}
STW.ct|#32770|Microsoft &ANDTHEN:Word&ANDTHEN:2.29&ANDTHEN:.doc
STW.ct|afx:|Microsoft Word V.2.29 vom 23-01-97 &ANDTHEN:liste.doc
STW.ct|#32770|{Mikrosx&TOLERANT:4}&ANDTHEN{&NOT:word}&ANDTHEN{&EXCEL&OR:Frontpage}
STW.ct|#32770|{Microsaft&TOLERANT:60}
See also:
•3.5 Hexadezimal, Decimal and Binary and more
•3.6 Using Quadrant-Coordinates