From the course: Scripting for Testers

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Generate fake input data

Generate fake input data - Python Tutorial

From the course: Scripting for Testers

Generate fake input data

- [Instructor] One of the challenges that every tester faces is that of coming up with input data to use in their testing. It can be tricky to come up with data that's realistic enough to fit your test case, and it can sometimes be boring to just enter the same data over and over. Luckily, with Python, you can easily generate many different kinds of inputs data. We've already written several scripts in this course that have required typing in different input data, so let's look at how we could generate some of that data instead. So here I have a script that's just creating five different gig objects on the server. Right now, as you can see, all five of these objects are going to be identical. They're going to have the same attributes. It would be nice to introduce a little bit of variation into these inputs. To do this, we can use the Python Faker Library. You can see the documentation for it at faker.readthedocs.io. And the first thing that we're going to need to do is to install…

Contents