Best Practices for Loadrunner Vugen scripting

Best Practices for Loadrunner Vugen scripting.

1. Follow proper script naming convention. Project Name_Scenario Count_Script Name.
Syntax - ProjectName_SCxx_ScriptName

2. Follow proper transaction naming convention. Script Name_ Transaction Count_Step Name.
Syntax - ScriptName_Txx_StepName

3. If script has multiple actions, name the actions properly.
Syntax - ACxx_ActionName

4. Place Think Time (lr_think_time) outside the transactions. Since placing the Think Time in between the transactions, it gets added up to the total Transaction Response time.

5. Try to place Correlation Function (web_reg_save_param) outside the transactions.Since Correlation Functions wait time also adds up to the total Transaction Response time. (Not always possible but still we can do whatever we can.)

6. Use proper condition blocks to validate the each transaction and fail them if the step is wrong.

7. Do a write up of the scripts flow in the vuser_init section.

8. Whenever you debug the script and make some changes to the script do a small write up about the changes made right above the modified request.

9. Follow proper parameterization naming convention. Parameterization naming should be P_ParameterName.

10. Follow proper correlation naming convention. Correlation naming should be C_ParameterName.
(Step 10 & 11 helps to differentiate between a user defined parameter and a correlation parameter.)

11. Do proper user sign off when the transaction fails to avoid user session issues.

12. If the script has customized code logic's, give a brief description on how the code logic works.

Why should we follow the above best practices?!

1. Makes script debugging easier and reduces the debugging time.
2. Gives an organised layout or structure to the script which makes the script understandable for anyone in the team, under the absence of the script creator.

No comments:

Post a Comment