KarelHusa's avatar
KarelHusa
Frequent Contributor
4 years ago
Status:
New Idea

Randomly generated values in requests and other ReadyAPI functions

Current situation

ReadyAPI DataGenerator provides different random values (random integer, email, name, city, etc.)

I like this function since it creates nice test data.

However, the random values are only accessible via DataGenerator DataSource.

 

Proposal

It would be great if we could use them in:

  • REST, SOAP, and other requests
  • Variable setup
  • Groovy scripts
  • etc.

In ReadyAPI the random values could be available via:

  • expansion e.g. ${#Random#FirstName}
  • Get data function adding a Random category in the top level

Implementation proposal

Wrapping Java Faker (https://github.com/DiUS/java-faker ) would do the task.

 

Java faker can be configured to use localized data (e.g. english names, spanish names, etc.)

The faker provides a lot of interesting data useful for testing, just to name few of them:

 

Address
Animal
App
Artist
Avatar
Aviation
Book
Business
Company
Color
File
Finance
Food
Name
Nation
Number
PhoneNumber

and many more, including some funny categories like ChuckNorris.

 

3 Comments

  • nmrao's avatar
    nmrao
    Community Hero

    In SoapUI OS, have implemented the data generation when a new step is added for REST requests of just one method  using the following library as the editor shows empty request page (unlike SOAP where at least xml nodes are shown) couple of years back. Little complex to implement though.

     

    https://github.com/rigorio/random-beans