State (%STATE) Macro

Applies to ReadyAPI 3.51, last modified on February 16, 2024

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.


The macro has the following syntax:




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.


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.


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