I am using unittest and selenium to automate my browser testing.
How would I go about making a test which I can run multiple times, where a user creates a ticket. The ticket has to has a title name, each time I run the test I want the title name to be random.
I would like the format: "Test ticket, 1 | Test ticket, 2..."
The faker module offers some functionality to populate several different types of data:
import faker f = faker.Faker() In : f. f.city f.full_address f.phonenumber f.zip_code f.company f.last_name f.state f.email f.lorem f.street_address f.first_name f.name f.username In : f.city() Out: u'Treyview'
If you are going to test randomly, I recommend randomly generating a seed (and logging it), that way you can recreate any failing tests. What you don't want is tests which fail but it's unclear why (i.e. if testing again, with different random values, passes).