Skip to Main Content
Return to Navigation

Reserved Words

This section defines PTF reserved words. The reserved words are listed alphabetically.

#CHECK#

Description

The #CHECK# reserved word modifies the behavior of a Set_Value action to be more like a Verify action. This can be useful when you want to set data in a particular field for one test case and verify the data in the same field for a different test case.

Note: If the values are not equal, PTF will always try to update the value (unless the object is display-only). If the values are equal, PTF will not update the value.

Example

For example, a text box could be set and verified with the following two steps:

Image: Example of setting a value and verifying a value in two steps

This example illustrates setting a value and verifying a value in two steps.

Example of setting a value and verifying a value in two steps

Suppose, however, that the test calls for using two test cases. The first test case sets the calculation name equal to KUSPTEST. The second test case verifies the value of KUSPTEST.

The test case that sets the value to KUSPTEST would be constructed as shown in the first step of the previous example. The test case that verifies the value as KUSPTEST would be constructed as shown in the following example:

Image: Example of setting a value and verifying a value using #CHECK#

This example illustrates setting a value and verifying a value using #CHECK#

Example of setting a value and verifying a value using #CHECK#

#DIS#

Description

This reserved word verifies a value and also checks whether the object is display-only. It logs a Fail if the object is not display-only or if the expected value does not match the application value.

If you use #DIS# without a value, then the value is ignored and #DIS# only checks for whether the field is disabled.

This reserved word is useful when, for example, PeopleCode is expected to make an object visible but not editable.

Example

The following example checks whether the Benefit Commencement Date field date is display-only and the value is equal to 07/12/2000:

Image: Example of using #DIS#

This example illustrates using #DIS# to verify that a field is display only and contains a specific date.

Example of using #DIS#

#DTTM

Description

Similar to #TODAY, the #DTTM reserved word inserts the current date and time into a field in the application.

Related Links

See Also:#TODAY

#EXIST#

Description

Verifies the existence of a field.

If the field exists in the application, a Pass is logged. If the field is not found, a Fail is logged.

If a value is passed after the closing # and the field exists, PTF tries to set the field to that value.

Example

In this example, the first step checks for whether the Benefit Plan field exists in the application and logs a Fail if it is not found. The second step not only checks for the existence of the field, it attempts to enter the value KUHP into it:

Image: Example of using #EXIST#

This example illustrates using #EXIST# , the first step checks for whether the Benefit Plan field exists in the application and logs a Fail if it is not found. The second step not only checks for the existence of the field, it attempts to enter the value KUHP into it.

Example of using #EXIST#

#FAIL#

Description

This reserved word works the same as #CHECK# but does not update the value after performing the comparison. If a mismatch is found, a Fail is logged; otherwise, a Pass is logged.

You would use #FAIL# rather than #CHECK# when you do not want to update the field if a mismatch exists.

Example

In this example, the PTF test logs a Fail if the Summary Calculation Name field is not equal to KUSPTEST:

Image: Example of #FAIL#

This example illustrates using #FAIL#, the PTF test logs a Fail if the Summary Calculation Name field is not equal to KUSPTEST.

Example of #FAIL#

#IGNORE

Description

Place the #IGNORE reserved word in the Value field of a Test.Exec step to skip the call to the child test. Suppose you have a parent test with two test cases. In the first test case, the parent test calls a child test. In the second test case, the parent does not call the child. Use the #IGNORE reserved word in the Value field with the second test case to skip calling the child for that test case.

In this example, the first step for the test case calls the test CHILD_ONE with test case CASE_01. The second step skips the call to CHILD_TWO for this test case.

Image: Example of the #IGNORE reserved word

This example illustrates

Example of the Test Exec action

#LIKEF#

Description

The #LIKEF# and #LIKEW# reserved words are similar to the #FAIL# and #WARN# reserved words except that they look for similar values, not an exact match. If a similar match is not found, #LIKEF# logs a Fail and #LIKEW# logs a Warning.

Similar to the behavior of #FAIL# and #WARN# (and unlike the behavior of #CHECK#), if the comparison fails, PTF does not update the value. The steps only affect the error state of the execution log.

This table details ways #LIKEW# or #LIKEF# can match strings:

Type of Match

Pattern

Match (Log a Pass)

No Match (Log a Fail or Warn)

Multiple characters

a*a

aa, aBa, aBBBa

ABC

Multiple characters

*ab*

abc, AABB, Xab

aZb , bac

Multiple characters

ab*

abcdefg, abc

cab, aab

Special character

a[*]a

a*a

Aaa

Single character

a?a

aaa, a3a, aBa

ABBBa

Single digit

a#a

a0a, a1a, a2a

aaa, a10a

Range of characters

[a-z]

f, p, j

2, &

Outside a range

[!a-z]

9, &, %

b, a

Not a digit

[!0-9]

A, a, &,

0, 1, 9

Combined

a[!b-m]#

~ An9, az0, a99

abc, aj0

Example

Suppose a test requires verification of only the first several characters of a text entry. In the following example, the first step logs a Fail if the first two characters of the Benefit Plan field are not equal to US. The second step logs a Fail unless the first two characters of the Benefit Plan field are equal to US and the last character is equal to 1:

Image: Example of using #LIKEF#

This example illustrates using #LIKEF# to verify only the first several characters of a text entry.

Example of using #LIKEF#

#LIKEF# and #LIKEW# only compare the date text of a date/time value. For example, some fields contain the current date and time. Use the #LIKEF##TODAY* construction to compare just the date portion of a Datetime field and ignore the time portion.

For example:

Image: Example of using #LIKEF##TODAY*

This example illustrates using #LIKEF##TODAY to verify if a specfic date is today’s date.

Example of using #LIKEF##TODAY*

#LIKEW#

Description

The #LIKEW# reserved word is used the same as #LIKEF# except it logs a Warning rather than a Fail. For complete details for using #LIKEW# see #LIKEF#.

#LIST#

Description

This reserved word checks the values of a ComboBox. It works with either the full text entries in the combo box or the metadata translation (XLAT) values of the entries.

Use #LIST# with a Set_Value action to check one or more values and then set an item in a drop-down list box, list the items separated by a vertical pipe (|) and place brackets ([]) around the item that you want to select. If the value in the field is not the same as the value in brackets, PTF logs an error and sets the value in the field to the value in brackets.

Example

This example shows the use of the #LIST# reserved word:

In this example, the first step verifies the existence of items in the list. The second step verifies that the items exist and verifies that Individual is selected.

Image: Example of using #LIST#

This example illustrates using #LIST#, the first step verifies the existence of items in the list. The second step verifies that the items exist and verifies that Individual is selected.

Example of using #LIST#

This example is similar to the previous example, but it refers to the entries by the metadata translation (XLAT) values rather than the text that actually appears in the combo box:

Image: Example of using #LIST# with translate values

This example illustrates using #LIST# with translate values.

Example of using #LIST# with translate values

#NOTEXIST#

Description

The opposite of the #EXIST# reserved word, #NOTEXIST# verifies that a field does not exist.

If the field does not exist, a Pass is logged. If the field does exist, a Fail is logged.

#NOTHING

Description

PTF ignores any step with a Set_Value or Verify action where the Value field is empty, or blank. The #NOTHING reserved word enables you to use SET_VALUE to set a field to blank or select a blank value from a drop-down list box. You can use #NOTHING with a Verify action to verify that a field is blank.

The #NOTHING reserved word does not have a closing pound sign (#). It cannot be used in combination with other reserved words.

Note: Leaving the Value field of a test step blank does not have the same effect as using the #NOTHING reserved word. PTF ignores any Set_Value or Verify action where the Value field is blank.

Example

In the following example, in the first step #NOTHING selects a blank value in the Calculation Reason field and then, in the next step, it verifies that the field is blank:

Image: Example of using #NOTHING

This example illustrates using #NOTHING to select a blank and to verify that the field is blank.

Example of using #NOTHING

#PREFIX#

Description

The #PREFIX# reserved word substitutes the text in the Prefix field in the Test Editor for the #PREFIX# string in the Value field.

This substitution is useful when developing a test that adds new data. It enables you to modify each new added record slightly so that the test is able to successfully add unique data each time the test is executed.

Example

Suppose you entered add in the Prefix field, as in this example:

Image: Example of Prefix field

This example illustrates the prefix field with the value add.

Example of Prefix field

The following test step would enter the value addUSER into the DERIVED_CLONE_OPRID field:

Image: Example of using #PREFIX#

This example illustrates a test step where the #PREFIX# is used in the value field.

Example of using #PREFIX#

Note: The #PREFIX# reserved word can only be used at the beginning of the text in the Value field.

#TODAY

Description

Substitutes the current date.

Note: The #TODAY reserved word does not have a closing pound sign (#). It cannot be followed by another reserved word.

Example

Suppose you have the following test instruction:

12. Enter the current date into the Event Date field.

The following step sets the value of the Event Date field to the date at the moment of test execution:

Image: Example of using #TODAY

This example illustrates using #TODAY.

Example of using #TODAY

You can use the + or – operators in conjunction with the #TODAY reserved word to reference a date in the future or past. In this example, the test verifies that the calculation event date is 10 days in the future:

Image: Example of using #TODAY+10

This example illustrates using #TODAY+10 to verify that the calculation event date is 10 days in the future

Example of using #TODAY+10

#WARN#

Description

This reserved word works the same as #CHECK# but does not update the value after performing the comparison. If a mismatch is found, a Warning is logged; otherwise, a Pass is logged.

You would use #WARN# rather than #CHECK# when you do not want to update the field if a mismatch exists.