Ask a Question

Randomly generated values in requests and other ReadyAPI functions

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
thePantz
Contributor

This is a fantastic idea! My only critique is maybe java-faker wouldn't be the repo to use as it hasn't been maintained recently. I would suggest a fork such as https://github.com/datafaker-net/datafaker/

KarelHusa
Champion Level 3

@thePantz, thanks for your suggestion. 

nmrao
Champion Level 3

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

Announcements
Welcome to the ReadyAPI Feature Requests board!

Here you can review submitted feature requests and vote up the ones you like! If you can't find the feature you want - go ahead and suggest your own idea. Ideas with the highest rating can be implemented in the product.

Check out the Create a Feature Request guide for more information.
New Here?
Welcome to the Community
Sign Up Here