Value From a Set (%SET) Macro

The Value From a Set macro is used to insert arbitrary values into the strings generated by a data source using the Custom String data generator. To specify values that will be used to generate data, you can either specify a list of items manually or load it from a text file.

The macro is an analog of the Value from a Set data generator.

Syntax

The macro has the following syntax:

%SET(Value1, Value2, Value3, ..., LastValue, GenerationMode)

Parameters

Examples

The following examples demonstrate how to use the Value From a Set macro:

  • %SET(John Smith, Kate Robson, Susan O'Neil, false)
    
    Example: Value From a Set macro in Data Generator

    Generates a string containing a random name – John Smith, Kate Robson or Susan O'Neil. ReadyAPI uses commas as delimiters. If a value includes spaces, there is no need to enclose this value in quotes.

  • %SET(Plum, Pear, Pineapple, true)
    

    Generates a sequence of fruit names.

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

Publication date: