Boolean (%BOOL) Macro

Applies to ReadyAPI 3.9, last modified on July 28, 2021

The Boolean macro is used to insert boolean data (true or false) into the strings generated by a data source using the Custom String data generator.

The macro is an analogue of the Boolean data generator.

Syntax

The macro has the following syntax:

%BOOL(ValueFormat)

Parameters

ValueFormat

Specifies the format of the generated data. The parameter can be one of the following values:

  • true/false (default)
  • Yes/No
  • 1/0

If you specify any other value, the custom string will not be parsed.

The values are case-insensitive.

Examples

The following examples demonstrate how to use the Boolean macro:

  • %BOOL(True/False)

    Example: Boolean macro in Data Generator

    Click the image to enlarge it.

    Generates True or False.

  • %BOOL(1/0)

    Generates 1 or 0 and repeats the generated value 3 times in a sequence of generated custom strings.

  • %BOOL(YES/NO)

    Generates Yes or No (the values are case-insensitive).

  • %BOOL(False/True) <— Invalid value

    This value is not supported. 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

Boolean Generator
Custom String Generator
Macro Reference

Highlight search results