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 sillyname = silly.name()
print("my name is {}".format(name))
# my name is colonel beefheartprint("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 Eightsilly.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]
Comments(0)