Placeholders¶
The Touchstone Placeholders are special predefined TestScript variables and may be used where standard TestScript variables are allowed: static fixtures, dynamic fixtures, operation.params, operation.requestHeader.value, operation.url, and assert.value element values.
These Touchstone Placeholders fall into two (2) categories
Predefined User Unique Data Values
Functions for Dynamic Data Generation
Predefined User Unique Data Values¶
The predefined user unique data value placeholders are strings of varying lengths from 1 to 20 characters. They are defined of three (3) types:
Character only; for example, ${C6}
Digits only; for example, ${D9}
Characters + Digits; for example, ${CD14}
Users may view their assigned placeholder variable values in Touchstone via the user name menu item ${} My Placeholders.
Guaranteed Value Uniqueness - All predefined user unique data value placeholder values with a character length of 6 or more are guaranteed to be unique.
Functions for Dynamic Data Generation¶
There are three (3) available functional constructs for dynamic data generation:
CURRENTDATE and CURRENTDATETIME
DATE and DATETIME (relative to dynamic variable)
UUID, UUID-ST, UUID-NODASH and UUID-ST-NODASH
CURRENTDATE[TIME]¶
These function placeholder variables provide support for date and datetime values based on the current date (today) and current datetime (now). Optional comma separated offset arguments apply date and time arithmetic providing relative date and time generated values.
Syntax/Format ${<placeholder name>[, <datetime portion code>, <offset value>]} Where,
<placeholder name> is CURRENTDATE or CURRENTDATETIME
<datetime portion code> is the character indicating what portion of the date or datetime value will be offset. Valid characters are derived from the following Java SimpleDateFormat pattern string “yyMMddHHmmss”
<offset value> is the signed integer value used to adjust the date or time
<datetime portion code>, <offset value> may be repeated for more complex arithmetic
Examples
Placeholder Example |
Description |
---|---|
${CURRENTDATE} |
The current date (today) |
${CURRENTDATETIME} |
The current date and time (today) |
${CURRENTDATE,d,-10} |
The date 10 days before the current date |
${CURRENTDATETIME,d,10} |
The date and time 10 days after the current date and time |
${CURRENTDATE,y,-1} |
The date 1 year before the current date |
${CURRENTDATETIME,H,10} |
The date and time 10 hours after the current date and time |
DATE[TIME]¶
These function placeholder variables provide support for date and datetime values based on a dynamic variable user input date or datetime value. Optional comma separated offset arguments apply date and time arithmetic providing relative date and time generated values.
Syntax/Format ${<placeholder name>, <relative value>[, <datetime portion code>, <offset value>]} Where,
<placeholder name> is DATE or DATETIME
- <relative value> is a dynamic variable defined in the current TestScript that holds the relative date or datetime value
The dynamic variable must be defined in TestScript without path/expression; its value will be entered by the user during Test Setup
<datetime portion code> is the character indicating what portion of the date or datetime value will be offset. Valid characters are derived from the following Java SimpleDateFormat pattern string “yyMMddHHmmss”
<offset value> is the signed integer value used to adjust the date or time
<datetime portion code>, <offset value> may be repeated for more complex arithmetic
Examples
Placeholder Example |
Description |
---|---|
${DATE, medicationDate} |
The value of the user entered medicationDate will be used as-is |
${DATETIME, medicationDateTime} |
The value of the user entered medicationDateTime will be used as-is |
${DATE, medicationDate, d, -10} |
The value of the user entered medicationDate minus 10 days will be used |
${DATETIME, medicationDateTime, M, -1} |
The value of the user entered medicationDateTime minus 1 month will be used |
UUID[-ST|-NODASH|-ST-NODASH]¶
These function placeholder variables provide support for generation of UUID values with predefined formatting.
Syntax/Format ${<placeholder name>} Where,
<placeholder name> is UUID, UUID-ST, UUID-NODASH or UUID-ST-NODASH
Examples
Placeholder Example |
Description |
---|---|
${UUID} |
A single generated UUID string value without the standard prefix; e.g., ‘3ed6eb79-fc68-443a-996f-08167f5bdef0’ |
${UUID-ST} |
A single generated UUID string value including the standard prefix; e.g., ‘urn:uuid:3ed6eb79-fc68-443a-996f-08167f5bdef0’ |
${UUID-NODASH} |
A single generated UUID string value without the standard prefix and dash characters removed; e.g., ‘3ed6eb79fc68443a996f08167f5bdef0’ |
${UUID-ST-NODASH} |
A single generated UUID string value including the standard prefix and dash characters removed; e.g., ‘urn:uuid:3ed6eb79fc68443a996f08167f5bdef0’ |
Usage¶
The Touchstone Placeholder, both predefined values and functions, are typically defined in static fixtures used as an operation request payload; for example, create or update. Touchstone’s TestScript Execution interface provides both a Raw and Resolved view of static fixtures where the pre and post test execution contents can be examined.
Raw Example - Patient.name, Patient.birthDate
<name>
<use value="official"/>
<family value="Smith${C7}"/>
<given value="John${C6}"/>
<birthDate value="${CURRENTDATE,d,-7}"/>
</name>
Resolved Example - Patient.name, Patient.birthDate
<name>
<use value="official"/>
<family value="SmithMqCERSQ"/>
<given value="JohnXRCnsc"/>
<birthDate value="2021-01-27"/>
</name>