Test Data Generation Libraries

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:

  • Meaningful
  • Consistent
  • Complete

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:

Name: Bruce
Last Name: Wayne
Gender: Male
Age: 34
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.

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

While choosing the right data generator look for consistency. If your user’s name is Peter Parker, his mail address should be peter.parker@blabla.com, not tony.stark@blabla.com

Some libraries provide that, some don’t.

May the good data be with you.



Database Operations in JavaFX

By Onur Baskirt / Apr 1, 2016 / 56 Comments
Before started this section, please check the first article and learn How to Start JAVAFX! http://www.swtestacademy.com/getting-started-with-javafx/ At first, part of JavaFX tutorial series, we created a sample JavaFX project, designed the draft version of the UI and set up an...
rest assured

REST API Testing with Rest Assured

By Onur Baskirt / Mar 8, 2016 / 32 Comments
Outline In this post, I will explain what is API and API testing, what is the difference between SOAP and REST services, and how to test REST APIs with Rest Assured Library. What is API? API stands for Application Programming...

How to Write Effective CSS Locators

By Onur Baskirt / Oct 1, 2017 / 0 Comments
Hi all, in this tutorial, I will describe you how to write effective CSS locators to interrogate web elements for your automation projects. As a rule of thumb, your interrogation strategy should be in below order: First try to use...

Selenium-11: Execute JavaScript with JavascriptExecutor

By Onur Baskirt / Jan 27, 2016 / 15 Comments
Outline Sometimes we cannot handle some conditions or problems with Webdriver, web controls don't react well against selenium commands. In this kind of situations, we use Javascript. It is useful for custom synchronizations, hide or show the web elements, change...

Getting Started with JavaFX

By Onur Baskirt / Mar 25, 2016 / 0 Comments
When I started to work in my current position, one of my task is to do manual operations for campaign products  every week. After the second week, I thought that I have to automate this task using a GUI based...

How to Write Smart XPath Locators

By Onur Baskirt / Sep 24, 2017 / 4 Comments
Hi all, in this tutorial, I will describe you how to write smart and non-brittle XPath locators. When we write our test scripts, we generally prefer to use id, name, class, etc. these kinds of locators. However, sometimes we could not...

Selenium-1: Quick Start to Automation with Selenium WebDriver & JAVA & JUnit & Maven & IntelliJ

By Onur Baskirt / Sep 8, 2015 / 26 Comments
Outline Selenium Webdriver is the most popular open source web test automation framework across wide range of browsers and platforms. In this tutorial you will learn how to do web test automation with Selenium Webdriver and the related tools. Audience...
page object model

Page Object Model with C#

By Ege Aksoz / Jun 18, 2017 / 8 Comments
In the previous tutorial, we’ve taken the initial steps and entered the world of automated testing. We also wrote our first automated test. From this point on, since we are not just going to write one test, we need to...

How to Select a Date From DatePicker Using Selenium

By Onur Baskirt / Aug 13, 2016 / 6 Comments
When you need to automate a airway, hotel, or similar websites you need to deal with Datepickers and some times it is a little bit cumbersome to select a specific date on the Datepicker or calendar.  In this post, I...

Selenium Webdriver Performance testing with Jmeter and Selenium Grid

By Ozgur Kaya / Aug 9, 2016 / 2 Comments
In this post, we will complete Selenium Webdriver Performance testing scenario using Jmeter and Selenium Grid. 1- Install Java 7 or later If necessary https://java.com/tr/download/ 2- Download latest Jmeter version 3.0 or higher. http://jmeter.apache.org/download_jmeter.cgi 3- Download Jmeter PluginsManager JAR file and...
By | 2017-04-15T17:15:11+00:00 April 15th, 2017|Data, Test Automation|1 Comment

About the Author:

Canberk Akduygu
Canberk Akduygu is working as a Technical QA Architect on test automation and performance testing. Formerly, he worked at TEB as QA Project Lead, Ayrotek IBM Business Partner and Yapi Kredi Bank as Java Developer. You can also follow him on Linkedin.

One Comment

  1. Gavin May 31, 2017 at 8:28 am - Reply

    jfaker is good one

Leave A Comment