Whenever a team of performance testers grows larger than three people, then it is time to assemble the team and create some LoadRunner scripting standards (or guidelines if you prefer to be less strict).

Documenting your team’s scripting standards helps junior performance testers avoid common mistakes and follow best practices. Experienced performance testers benefit from having consistency between scripts, so there is less confusion when work is transferred between team members.

I have developed a short quiz so you can test your knowledge of some of the VuGen scripting best practices.

Before you attempt the quiz, you should read the following articles:

[iframe_loader width=’100%’ height=’500′ frameborder=’0′ src=’https://www.myloadtest.com/wp-content/uploads/migrated-resources/articulate_uploads/loadrunner-scripting-standards/quiz.html’]

I have worked at some big companies that had clear LoadRunner scripting standards but still had teams of performance testers writing really bad VuGen scripts. Defining a scripting standard is a futile task unless there is a way to measure and encourage compliance with the standard. The only practical way to do this is with an automated checking tool.

I have developed the VuGen Validator, which checks scripts as they are uploaded to Performance Center and helps testers write better scripts. The quiz contains a small number of the guidelines that are checked by the Validator.

If you have your own best practice suggestions for VuGen scripting, please leave a comment.

 

Published On: February 20, 2013Tags: ,

6 Comments

  1. Stuart Moncrieff February 21, 2013 at 9:38 pm

    It is common for VuGen scripting standards to require that each script has a standard header with the performance testers name and email address, a description of the business process steps, and any useful notes or caveats.

    VuGen Script Templates are an easy way to ensure that all scripts start with a comment block containing placeholders to remind the performance tester to include this information.

  2. cheng July 25, 2013 at 2:10 am

    so what is the correct code for the last question?

    • Stuart Moncrieff July 26, 2013 at 7:04 pm

      Generally, I would prefer that people wrote their LoadRunner string manipulation functions like this:

      void convert_string(char* input, char* param_name)
      {
          char* buf = (char*)malloc(strlen(input) + 1); // allocate enough memory for your output string. 
          // e.g. a URL-encoding function should allocate 3 * strlen(input) + 1, as each input character 
          // could become 3 characters.
          // Note: you should add code to catch a memory allocation failure
          // 
          // I have removed the body of the function for space reasons.
          // Let's assume it does something with the input string in a loop.
          buf[i] = NULL; // null terminate the new string, then save it to a parameter
          lr_save_string(buf, param_name);
          free(buf);
          return;
      }
      

      The code example can’t overflow the buffer (as long as you malloc the correct number of bytes), and the output is saved to a parameter instead of being returned as a pointer (to an area of memory that will go out of scope).

  3. Rajesh kuchana June 11, 2014 at 6:26 pm

    HI,

    Thank you for your information.I am interested in loadrunner and have searched so many websites no where it is mentioned clearly that how to write scripting using c language.
    If you have any materials to learn loadrunner easily please forward me.

    my email id is rajeshchevronne@gmail.com

  4. sharath December 4, 2014 at 8:02 pm

    Dear Stuart Moncrieff,

    I am sharath from India I have started learning loadrunner.
    Can you please guide by sharing use full videos or scripts for beginner towards performance testing.

    Thanks

  5. veera June 18, 2015 at 9:13 pm

    Hi Stuart,

    Could you explain briefly about client side rendering and page level response times?
    why do we use Running vuser as a process and Running vuser as a Thread?is it for only memory consumption or something else?

    Regards,
    Veera.

Comments are closed.