Saturday, September 12, 2009

Using parameters in Loadrunner VuGen script

Parameterizing is a powerful thing in LoadRunner!
Now, I'm going to demonstrate some tips and uses of them.

Well, imagine the following situation...

Let's we have created VuGen script, which emulates the one user:

The problem: script runs correctly in VuGen for one user, but it fails for several concurrent users. This happens since we recorded the VuGen script for the specific user:
I marked
"username" and "password" parameters and values with red lines.
Application under test (AUT) does not allow several sessions of the same user.
So, if second concurrent VuGen user logs in to application, he gets an error:
The solution: to parameterize the VuGen script.

Implementation:



The summary: Parameterizing allows simplify load/performance testing:

  1. Instead of writing a separate LoadRunner VuGen script for each virtual user, we added parameters for specific information (username & password) and used the one script for all users.
  2. Parameterizing allows decrease maintenance cost. If application under test is changed, one test should be updated for 100 (e.g.) users, but 100 tests for each user
  3. Supporting of tests is a real pleasure :) To add new user, a test has to update dat-files only.


All three advantages is the result of data-driven testing methodology.
I plan to describe later how to write data-driven tests, what concepts should be used, and so on

2 comments:

Unknown said...

How do you use single dat file for more than one parameter ?

Ajay said...
This comment has been removed by the author.