Hi JD,
yes, you can certainly do parametrization and data-driven testing. I
don't have any examples posted, but I'll add some content to the wiki
and update this thread when I get some time.
but basically...
since your scripts are pure python, you have a lot of options of how
you want to implement a data driven test. you can embed data in your
scripts, or read from a db, or file. The easiest approach for a case
like yours is probably to have a text file containing your parameter
values. you could have a rows of csv values like "username, password,
whatever".
then, inside the __init__() method of your test Transaction, you can
load the data files with a csv reader and have access to the data from
inside your run() method.
also...
scripts have access to the following variables which can be useful for
loading unique data:
- thread_num
- process_num
so.. lets say I have a simple data file that is just a list of user
names. I can do something like this to load data inside my
__init__():
with open('/path/usernames.txt') as f:
self.user_names = f.read().splitlines()
then inside my run() method, I can do:
user_name = self.user_names[self.thread_id]
and user_name would be unique to that VU/thread.
That is a really rushed explanation and perhaps hard to follow :)
I'll get together some sample code and post it when I get time.
hth,
-Corey