selenium - Random data for test automation in python -
i using unittest , selenium automate browser testing.
how go making test can run multiple times, user creates ticket. ticket has has title name, each time run test want title name random.
i format: "test ticket, 1 | test ticket, 2..."
the faker module offers functionality populate several different types of data:
import faker f = faker.faker() in [11]: 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 [11]: f.city() out[11]: u'treyview' .
if going test randomly, recommend randomly generating seed (and logging it), way can recreate failing tests. what don't want tests fail it's unclear why (i.e. if testing again, different random values, passes).
Comments
Post a Comment