Vuser Scripting

The following blog article will guide and help the users in creation of Vuser scripts in LoadRunner

  • Open Virtual user generator.
  • Select file-> new script and solution and name it accordingly. From the protocol portion select web-http/html. Press Create.
  • Now the actions will be recorded for the generation of the script. To start recording press the red circular button from the menu bar. In the start recording window enter the url of the website.
  • Change the application to record to Google Chrome or any browser present in your machine. Press Start recording.
  • Different functions of the website like login, browsing different links, search, logout etc. After the browsing is over stop the recording.
  • LoadRunner will automatically create a script for you and search for the dynamic variables like cookies, session id etc that change every time we connect with the website. It will show all those variables that should be correlated to make script run without any errors.
  • Design studio box list does values and will ask whether we want to perform correlation. Click Correlate button.Correlation will be performed and the dynamic values will be replaced with parameters.
  • You can also create a rendezvous point where you want every vuser to meet there and then proceed further. Right click before the action where you want to perform rendezvous and select insert->rendezvous and name it.
  • One can also create a transaction for the functions which are very important from the functionality point of view. Select the place you want to start transaction. Right click select Insert->Start transaction. Then name your transaction by writing the name within the double quotes provided. Again when you want to end the transaction right click and select Insert->End transaction and then write the name of the transaction you are ending.
  • While logging a username and password is used, to parameterise them to make it dynamic, search for the username and password in the script. Select the value and right click select replace with parameter->create new parameter.
  • In the select or create parameter box write the name of the parameter and select the type of the parameter. Now click on properties. If File is selected you will see a table with one row and column with the value equal to the value used during login. We can add more values by adding new row. Now click close and then OK.
  • Do it similarly for the password or any other values like search term etc.
  • Now replay the script by clicking the green play button. If the script gets passed it means it is error free, you can proceed further else search for the errors and fix them and again replay the script.

Thus in this way we create scripts and modify it with correlated parameters, rendezvous, transactions and user based parameters.