Hi all, I will give you some information about random data generator libraries that you can use in your test automation projects. If you have developed automation code, you might have experienced difficulty while creating test data. One can use hard-coded data or randomize the data generation. Hard-coded data is mainly a bad choice because of uniqueness problems that are why random data generation might be a better fit.
Data generation is hard to maintain a good data most have below characteristics:
Let’s think that we have to create a new user on an e-commerce website and we define a “male” user. This user might have below attributes:
Last Name: Wayne
Birth City: Gotham
But what if you need to create a “female” user! You may need to change some fields like “name” and you definitely need to change “gender” because Bruce is a male name. If you don’t change the name according to the gender, you might have meaningless and sometimes inconsistent data in your system.
Those kinds of situation pushed me to look for a solution and I have found some libraries. Below libraries might be very easily integrated into your test automation projects developed with JAVA.
I will share some examples of Jfairy. It shows you how easy to integrate it with your project.
Fairy fairy = Fairy.create();
Person person = fairy.person();
// Chloe Barker
Person adultMale = fairy.person(male(), minAge(21));
// at least 21 years earlier
Those ones can be used for Ruby projects.
Those two can be used for .NET projects
These libraries can help you create many types of data like address, phone number (some libraries can create data according to Locale that you prefer), company, user, orders, etc…
A Final Tip
Some libraries provide that, some don’t.
May the good data be with you.