Specify values

In addition to simple character strings and numerical data, you can specify the following values in the Value column:

Specify all dynamic expressions with the following syntax:

Syntax:

{COMMAND[Parameter 1][Parameter 2]…[Parameter n]}

Depending on the specific command, parameters are optional.

Engines 3.0 values support special characters and wildcards.

Special characters

Tricentis Tosca uses special characters to work with different operations, such as wildcards and dynamic expressions. These characters are {, }, [, ], ", and *. Moreover, there are additional special characters if you work with regular expressions in your tests.

If you want to use special characters as text in your tests, you must escape them. This way, Tricentis Tosca interprets the special character as part of a text string. You can do this as follows:

  • With double quotation marks (") before and after the special character or string. Double quotation marks can escape all special characters, except for those in regular expressions.

  • With a backslash (\) before the special character. Note that you can only use a backslash to escape special characters within regular expressions.

  • By right-clicking the Value field and selecting Escape value. In this case, Tricentis Tosca automatically escapes the entire field with double quotation marks.

Escape with double quotation marks

You can use double quotation marks (") to escape an entire string of text or individual special characters.

To escape special characters, add double quotation marks before and after the special character or string you want to escape.

In this example, you want to use the value Tric*ntis as plain text. Since * is a special character, you escape it with double quotation marks. Consequently, you enter either Tric"*"ntis or "Tric*ntis".

However, there's an exception if you want to escape a double quotation mark with double quotation marks. In this case, you need two types of escaping:

  • Double quotation marks to escape the double quotation mark character.

  • An additional leading double quotation mark. This tells Tricentis Tosca that the subsequent " is the actual string and not the end of an escaped string.

In this example, you want to use the value {"Example"} as plain text. Since " is a special character, you escape it with two double quotation marks, followed by an additional double quotation mark.

Consequently, you enter "{""Example""}":

  • The " in the beginning and the end escape the entire string, including the special characters { and ".

  • The " tells the system to treat the subsequent " as a string.

Escape special characters in regular expressions with a backslash

You can use a backslash (\) to escape individual special characters in regular expressions.

To escape special characters in regular expressions, add a backslash before the special character or string you want to escape.

In this example, you want to use the value Tric*ntis?\n as plain text in a regular expression. Since *, ?, and \ are special characters in regular expressions, you escape them with backslashes. Consequently, you enter Tric\*ntis\?\\n.

Wildcards

Tricentis Tosca supports wildcards * in the following cases:

You can enter more than one wildcard, e.g. *ri*n*s instead of Tricentis.

If you want to use the asterisk as part of a string and not as a wildcard, you need to escape it.

In this example, you are searching for a row that contains a cell whose content ends with 1967.

In this row, you are looking for a cell in a column whose header starts with Last.

Then you verify whether the content of this cell is Smith.

Wildcards in a table

In this example, you use the parameter Title to search for a caption.

The value Vehicle Insurance* specifies that the caption starts with Vehicle Insurance.

Wildcard in the parameter Title