Default placeholders

You can use default placeholders to customize the systemwide placeholders such as properties, date, and time of any script template.


system placeholder

Usage: Use to customize any script template.

Syntax: %system:argument%

Description: Uses a Java system property as the argument.

Arguments for the system placeholder:

java.version -- Returns the Java Runtime Environment version.

java.vendor -- Returns the Java Runtime Environment vendor.

java.vendor.url -- Returns the Java vendor URL.

java.home -- Returns the Java installation directory.

java.vm.specification.version -- Returns the Java Virtual Machine specification version.

java.vm.specification.vendor -- Returns the Java Virtual Machine specification vendor.

java.vm.specification.name -- Returns the Java Virtual Machine specification name.

java.vm.version -- Returns the Java Virtual Machine implementation version.

java.vm.vendor -- Returns the Java Virtual Machine implementation vendor.

java.vm.name -- Returns the Java Virtual Machine implementation name.

java.specification.version -- Returns the Java Runtime Environment specification version.

java.specification.vendor -- Returns the Java Runtime Environment specification vendor.

java.specification.name -- Returns the Java Runtime Environment specification name.

java.class.version -- Returns the Java class format version number.

java.class.path -- Returns the Java class path.

java.ext.dirs -- Returns the Path of extension directory or directories.

os.name -- Returns the operating system name.

os.arch -- Returns the operating system architecture.

os.version -- Returns the operating system version.

file.separator -- Returns the File separator ("/" on UNIX®), ("\\" on Windows ).

path.separator -- Returns the Path separator (":" on UNIX), (";" on Windows).

line.separator -- Returns the Line separator ("\n" on UNIX), ("\r/n" on Windows).

user.name -- Returns the User's account name.

user.home -- Returns the User's home directory.

user.dir -- Returns the User's current working directory.

Examples:

%system:java.version% -- Returns the Java Runtime Environment version.

%system:java.vendor% -- Returns the Java Runtime Environment vendor.

%system:java.vendor.url% -- Returns the Java vendor URL.


date placeholder

Description: Returns the current date in the format specified and uses the following arguments with appropriate separators.

Syntax: %date: argument%

Comment: This placeholder follows the java.text.SimpleDateFormat format specification.

Arguments for the date placeholder:

yyyy -- Returns the year (4 digits).

yy -- Returns the year (2 digits).

MMM -- Returns the month (short name).

MM -- Returns the month (2 digits).

M -- Returns the month ( 1 or 2 digits).

EEEE -- Returns the day of week.

EE -- Returns the day of week short form.

dd -- Returns the day of month (2 digits).

d -- Returns the day of month (1 or 2 digits).

hh -- Returns the hour 1-12 (2 digits).

HH -- Returns the hour 0-23 (2 digits).

H -- Returns the hour 0-23 (1 or 2 digits).

KK -- Returns the hour 0-11 (2 digits).

K -- Returns the hour 0-11 (1 or 2 digits).

kk -- Returns the hour 1-24 (2 digits).

k -- Returns the hour 1-24 (1 or 2 digits).

mm -- Returns the minute.

ss -- Returns the second.

SSS -- Returns the millisecond.

a -- Returns the AM or PM.

zzzz -- Returns the time zone.

zz -- Returns the time zone (short form).

F -- Returns the day of week in month (that is, 3rd Thursday).

DDD -- Returns the day in year (3 digits).

D -- Returns the day in year (1, 2, or 3 digits).

ww -- Returns the week in year.

G -- Returns the era (BC or AD).

' -- Allows text within single quotes to appear in a script rather than interpreting the text as a command. (For example: 'dog' prevents dog from being processed).

'' -- Allows a single-quote character to appear in a script rather than interpreting the character as a command.

Examples:

Example of data placeholder Result
%date:yyyy.MM.dd G 'at' hh:mm:ss z% 2005.07.10 AD at 15:08:56 PDT
%date:EEE, MMM d, ' ' yy% Wed, July 10, '05
%date:h:mm a% 12:08 PM
%date:hh 'o"clock' a, zzzz% 12 o'clock PM, Pacific Daylight Time
%date:K:mm a, zz% 3:26 PM, PST
%date:yyyy.MMMMM.dd GGG hh:mm aaa% 2005.July.10 AD 12:08 PM


time placeholder

Description: Returns the current date in the format that you specify and uses the following arguments with appropriate separators. This placeholder extends the date placeholder. You can use the same date placeholder arguments, with the additional argument for milliseconds since 1970/01/01 00:00:00.000 GMT.

Syntax: %time: argument%

Comment: This placeholder follows the java.text.SimpleDateFormat format specification.

Additional argument for the time placeholder:

SSSS -- Returns milliseconds since 1970/01/01 00:00:00.000 GMT.

Example: %time:SSSS% -- Returns milliseconds since 1970/01/01.


env placeholder

Description: Uses an environment variable specified as the argument. Any number of environment variables are available on a system. These values are system dependent.

Syntax: %env: argument%

Arguments for the env placeholder:

PATH -- Returns the executables path.

TMPDIR -- Returns the temporary directory.

HOME -- Returns the users home directory.

Example: %env:PATH%


option placeholder

Description: Returns the value of a specified Functional Tester customizable option for script execution.

Syntax: %option: argument%

For information about the available option arguments, see Modifying Options for Script Execution topic.

Examples:

%option:rt.project% -- Replaced by the Test Manager project name.

%option:rt.time.delay_before_gui_action% -- Replaced by the time delay before any user interface action is performed.

%option:rt.time.delay_before_mouse_down% -- Replaced by the time delay and inserted before a mouse down event is delivered.


static placeholder

Description: Invokes the specified parameterless static method. The static methods depend on the classes available in the user's Java environment.

Syntax: %static: method% where method is any visible complete Java static method specification.

An argument for the static placeholder includes:

java.lang.System.currentTimeMillis -- Returns the time since 1/1/1970.

Examples:

%static:java.lang.System.currentTimeMillis% -- Returns the time in milliseconds since 1/1/1970.

%static:com.rational.test.ft.script.ScriptUtilities.getOperatingSystemVersion -- Returns host-specific operating system version information.


Related concepts

Customizing script templates

+

Search Tips   |   Advanced Search