State (%STATE) Macro

Applies to ReadyAPI 3.10, last modified on October 07, 2021

The State macro is used to insert US state names into the strings generated by a data source using the Custom String data generator.

The macro is an analog of the State data generator.

Syntax

The macro has the following syntax:

%STATE(Format)

Parameters

Format

Specifies the format of state names to be generated:

  • FULL – Default. The macro generates full state names – for example, Florida, Texas, and so on.

  • Abbreviated – The macro generates abbreviated state names – for example, FL, TX, and so on.

The values are case-insensitive.

Examples

The following example demonstrates how to use the State macro:

  • State: %STATE(FULL)

    Example: State macro in Data Generator

    Click the image to enlarge it.

    Generates a string containing a full state name.

  • %STATE(Abbreviated)

    Generates abbreviated state names.

  • %STATE <- Invalid value

    The macro requires the parameter, so ReadyAPI will not parse the custom string.

  • %STATE(COUNTY) <— Invalid value

    The parameter is specified incorrectly, so ReadyAPI will not parse the custom string.

Remarks

For more information on adding macros to custom strings, see About Custom String Generator.

For more information on general rules used for specifying macro parameters, see Custom String Generator Rules.

See Also

State Generator
Custom String Generator
Macro Reference

Highlight search results