Generate Random Test Data using Silly Python Library - Codoid
Select Page
Codoid Blog

Generate Random Test Data using Silly Python Library

Irrespective of the business that your client is in, marketing is an integral part of their operations. In fact, in this day and age of social.

Generating random test data during test automation execution is an easier job than retrieving from Excel Sheet/JSON/YML file. If you start maintaining dummy test data in an external file, it will increase test data feeding time before you begin the automated regression test suite.

You can generate random test data using Silly Python library if you have Selenium automated test suite in Python. Let’s see how to use it.

Installation

pip install silly
[/code]

How to use

import silly

name = silly.name()
print("my name is {}".format(name))
# my name is colonel beefheart

print("you should not contact me at {}".format(silly.email()))
# you should not contact me at [email protected]

number = silly.number()
print(number)
# 7
number_in_words = silly.numberwang()
print(number_in_words)
# Eighty Eight

silly.paragraph()
# Youssef Chiffon needs a cluster of white dances, badly.
# Cabinet Management Systems is the best company in Bagsberg.
# Armourshire is in North Testonia. Fear space!

silly.paragraph(length=1000)
# oh no! that was the length in SENTENCES!
# what have we done!
# oh well
# let's do this anyways:
#
# Cheekshop is the best company in Birmingplace.
# Cornelius Slabmove will braise a heart, seventy-two rum staffs,
# and one hundred and thirty-two plans. Mysteriousshire Plumbing
# is the best company in Coasttown. Your mom can't wait to punch
# one hundred and thirty-seven brown socks in Jerkhall....
[/code]

Written By

Submit a Comment

Your email address will not be published. Required fields are marked *


Generating random test data during test automation execution is an easier job than retrieving from Excel Sheet/JSON/YML file. If you start maintaining dummy test data in an external file, it will increase test data feeding time before you begin the automated regression test suite.

You can generate random test data using Silly Python library if you have Selenium automated test suite in Python. Let’s see how to use it.

Installation

pip install silly
[/code]

How to use

import silly

name = silly.name()
print("my name is {}".format(name))
# my name is colonel beefheart

print("you should not contact me at {}".format(silly.email()))
# you should not contact me at [email protected]

number = silly.number()
print(number)
# 7
number_in_words = silly.numberwang()
print(number_in_words)
# Eighty Eight

silly.paragraph()
# Youssef Chiffon needs a cluster of white dances, badly.
# Cabinet Management Systems is the best company in Bagsberg.
# Armourshire is in North Testonia. Fear space!

silly.paragraph(length=1000)
# oh no! that was the length in SENTENCES!
# what have we done!
# oh well
# let's do this anyways:
#
# Cheekshop is the best company in Birmingplace.
# Cornelius Slabmove will braise a heart, seventy-two rum staffs,
# and one hundred and thirty-two plans. Mysteriousshire Plumbing
# is the best company in Coasttown. Your mom can't wait to punch
# one hundred and thirty-seven brown socks in Jerkhall....
[/code]