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.

 

2 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
Super Contributor

@thePantz, thanks for your suggestion. 

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