Regular expressions
Regular expressions (REGEX) can be used in Tosca Commanderâ„¢ along with a variety of different functions. This chapter provides you with syntax and examples for various use cases.
For further information on how to use regular expressions in Tosca TBox, please refer to chapter "Regular expressions". |
TC String Operation
Strings can either be modified or verified by using regular expressions. For this purpose, we use the Exchange Portal Module TC String Operations.
Regular expressions in control identification
Regular expressions can be used for the technical identification of controls. This applies to the following technologies:
Engine |
Supported regular expressions |
---|---|
DotNet Engine |
|
Java Engine |
|
SAP Engine |
|
Siebel Engine |
DotNet Engine - Identifying controls
Regular expressions are specified according to the following syntax:
Syntax: |
REGEX[<Regular expression>] |
.Text=REGEX[.*Button1$] instead of .Text=MyNewButton1 |
Java Engine - Technical ID
Regular expressions are specified without using any additional syntaxes.
Name=.*ditfield instead of Name=editfield |
SAP Engine
Regular expressions can be used with the following syntax in screen and control identification:
Syntax: |
{RegEx[<Regular expression>]} |
{RegEx[/usr/.*/txtF1]} instead of /usr/subSA_0100_1:SAPLEXAMPLE_ENTRY_SCREEN:0200/subSA_200_2:SAPLEXAMPLE_ENTRY_SCREEN:1200/txtF1 |
Siebel Engine - Identifying controls
Regular expressions are specified without using any additional syntaxes.
RepositoryName=.*EditViewLayout instead of RepositoryName=ButtonEditViewLayout |
Siebel Engine
The Siebel Engine allows regular expressions to be used for steering SiebelMenus, SiebelPageTabs and SiebelTrees with the following syntax:
Syntax: |
REGEX[<Regular expression>] |
{REGEX[^Opportu]}->Opportunities List instead of Opportunities->Opportunities List |
SAP Engine
Regular expressions can be used in the SAP Engine when specifying TableTree paths (see chapter "Using wildcards and regular expressions in paths").
Filtering TestCase-Design instances
In TestCase-Design, you can use the Filter column in order to limit the number of displayed TestCase-Design instances. If you select the Regular Expression button from the drop-down menu, you can use regular expressions for filtering.
In this example, the number of instances is restricted to those which start with Truck. For this purpose, the regular expression ^Truck is used.
Filtering instances |
The regular expression in this example limits the displayed instances to those whose name is a number greater than 150. (^1[5-9][0-9]$)|(^[2-9]\d{2}$)|(^[1-9]\d{3}\d*$) |