Reserved Words

This section describes PTF reserved words, listed in alphabetical order.

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:

Type

Action

Recognition

Parameters

Value

Text

Set_Value

ID=PA_CLC_SUMMARY_CALC_NAME

KUSPTEST

Text

Verify

ID=PA_CLC_SUMMARY_CALC_NAME

KUSPTEST

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:

Type

Action

Recognition

Parameters

Value

Text

Set_Value

ID=PA_CLC_SUMMARY_CALC_NAME

#CHECK#KUSPTEST

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:

Type

Action

Recognition

Parameters

Value

Text

Set_Value

Name=PA_CALCULATION_BEN_CMDT_DATE

#DIS#07/12/2000

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

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:

Type

Action

Recognition

Parameters

Value

Text

Set_Value

Name=PA_CLC_PLN_INPT_BENEFIT_PLAN

#EXIST#

Text

Set_Value

Name=PA_CLC_PLN_INPT_BENEFIT_PLAN

#EXIST#KUHP

Description

This reserved word works like #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:

Type

Action

Recognition

Parameters

Value

Text

Set_Value

ID=PA_CLC_SUMMARY_CALC_NAME

#FAIL#KUSPTEST

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.

Type

Action

Recognition

Parameters

Value

Test

Exec

CHILD_ONE

CASE_01

Test

Exec

CHILD_TWO

#IGNORE

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:

Type

Action

Recognition

Parameters

Value

Text

Set_Value

Name=PA_BENEFIT_PLAN

#LIKEF#US*

Text

Set_Value

Name=PA_BENEFIT_PLAN

#LIKEF#US*1

#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:

Type

Action

Recognition

Parameters

Value

Text

Set_Value

Name=PA_PROP_VOUCH_DTTM

#LIKEF##TODAY*

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#.

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.

Type

Action

Recognition

Parameters

Value

ComboBox

Set_Value

Name=PA_CALC_CALC_TYPE

#LIST#Individual|Pre-Defined Group|Pre-Defined List

ComboBox

Set_Value

Name=PA_CALC_CALC_TYPE

#LIST#[Individual]|Pre-Defined Group|Pre-Defined 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:

Type

Action

Recognition

Parameters

Value

ComboBox

Set_Value

Name=PA_CALC_CALC_TYPE

#LIST#I|G|L

ComboBox

Set_Value

Name=PA_CALC_CALC_TYPE

#LIST#[I]|G|L

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.

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:

Type

Action

Recognition

Parameters

Value

ComboBox

Set_Value

Name=PA_CALC_REASON

#NOTHING

ComboBox

Verify

Name=PA_CALC_REASON

#NOTHING

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:

Type

Action

Recognition

Parameters

Value

Text

Set_Value

Name=DERIVED_CLONE_OPRID

#PREFIX#USER

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

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:

Type

Action

Recognition

Parameters

Value

Text

Set_Value

ID=PA_CLC_EMP_VW_EVENT_DT

#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:

Type

Action

Recognition

Parameters

Value

Text

Set_Value

ID=PA_CLC_EMP_VW_EVENT_DT

#TODAY+10

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.