Saturday 15 August 2015

what is LoadRunner parameter

This is a simple question - what is LoadRunner parameter? 

I've reread LoadRunner VuGen User's Guide v9, trying to find the exact definition of LoadRunner parameter. That's strange, but LoadRunner Help does not contain the exact answer on this question.

In this article, I will answer basic questions, connected to LoadRunner parameters.
I think, LR beginners should study this article carefully :)

So, I recommend to read it, if you want to know:
  • the definition of LoadRunner parameter
  • LoadRunner parameter functions
  • how to create parameter in LoadRunner VuGen script
  • which types of LoadRunner parameter are available
  • how LoadRunner processes parameters - gets and sets their values
  • other key concepts, connected to LR parameters
OK, let's start.

I've recorded Web (HTTP/HTML) simple script on Web Tours demo web application. There are two first steps:

Please, notice that we use the following hard-coded username & password - jojo and jojo:
  1. "Name=username", "Value=jojo"ENDITEM,
  2. "Name=password", "Value=bean"ENDITEM,
They are hard-coded in the script! This is important.


What should we do, if we want to execute our script sequentially for different users, for example for jojo/bean, then for bob/lcdmdm/psswrd, and so on?

There are several solutions:
  • The simplest one is to record our script for each user.
    In this case, our pseudocode will look like:
  1. Login as jojo/bean
  2. Perform other actions under jojo/bean

  3. Login as bob/lcdm
  4. Perform other actions under bob/lcdm

  5. Login as dm/psswrd
  6. Perform other actions under dm/psswrd
  7.  
  8. so on...
As you can see, our code is duplicated. Actually, this is not good idea (read this article to find out why it is).
  • We can remake our code:
  1. Loop - perform next actions for each user name and password
  2.     Read user name and password into {UserName} and {Password} variables
  3.     Login as {UserName} and {Password}
  4.     Perform other actions under {UserName} and {Password}
So, what have I done?

No comments:

Post a Comment