User cases
There are many “special” characters in the Unicode character set , such as ~!@#$%^&*()-+. However, within the TestArchitect system, only two characters, pound key (#) and double quotes (") are treated as special:
Pound key (#)
|
Used to begin an expression.
|
Double quotes (")
|
Used to separate variable and string in expression.
|
This document guides you in handling these two special characters if you need to input them as test data into your AUT, or output them in reports or results.
A couple of example scenarios:
Scenario 1:
Assume that that AUT requires the user to enter an address, and one line of user’s address is a suite number, which starts with a pound # character (e.g., Suite #B, as below)
Scenario 2:
Variables
|
Expected string
|
|
type
|
quote
|
|
Idiom
|
Diamond cuts diamond
|
Idiom: "Diamond cuts diamond"
|
Assume we want to combine the text strings of two variables in the above table, type and quote, into one string, separating them with a colon and space (": "), and surrounding the contents of quote with double quotes. The expected string is:
Idiom: "Diamond cuts diamond"
The question is, how to notify TestArchitect that the double quotes at the beginning and end of the quote string are part of the text, so that TestArchitect does not treat them as operators?
Solutions
1. Scenario 1: "#" character at the beginning of a string
TestArchitect normally recognizes the pound (#) character at the beginning of a string as declaring the remaining string to be an expression. If you want to use it as a string, insert a back slash ( \ ) escape character before the #.
Option A: Using the string directly:
Option B: Using the string via variable:
2. Scenario 2: Handling a double quote as a string
The two variables type and quote have values set as below:
In an expression, TestArchitect recognizes a string of four double ("""") quotes as an escape sequence representing a single double quote. Hence, to combine the values of the two variables into one string and put the contents of variable quote into double quotes, do the following:
The test results indicate that the variable full sentence contains the exact string we want:
- Result: