Applies to ReadyAPI 3.3.1, last modified on August 11, 2020

You can use a Groovy script to generate random values and use them to enhance your tests.

This topic describes how to generate random IDs with the Universally Unique Identifier (UUID) feature.

Availability

You can use this script anywhere in ReadyAPI.

Examples

  • The following code demonstrates how to generate a UUID and use it as a variable:

    Groovy

    // Generating a random variable value.
    def var = UUID.randomUUID()

    // Logging the variable.
    log.info var
  • The following code demonstrates how to generate a UUID in a string:

    Groovy

    // Generating a random item identifier.
    log.info "Item: ${java.util.UUID.randomUUID()}"

See Also

Groovy Scripts

Highlight search results