Introduction-to-Loadrunner-Part-4

Posted on Nov 15 2007 - 1:07pm by Raj

{mosgoogle} 

Directory Structure 

  •   While recording, VuGen creates a series of configuration, data, and source code files which contain Vuser run-time and setup information.
  •   The results of each iteration of a script are stored separately.
  •   The Iteration0 directory is for system use and should be ignored by the tester.

    • While recording, VuGen creates a series of configuration, data, and source code files which contain Vuser run-time and setup information.
    •   The results of each iteration of a script are stored separately.
    •   The Iteration0 directory is for system use and should be ignored by the tester.

LoadRunner Transactions

  • action that is made from the browser.
  • Click the Start Transaction button (      ) after selecting the starting point for measurement
  • Click the End Transaction button (      )after selecting the end point for measurement.
  • Select Transaction Status (optional) – LR_AUTO, LR_PASS, LR_FAIL

Note:   LoadRunner Transactions can also be inserted  during recording

Parameterization 

Parameter
A parameter is a placeholder which re-places a recorded value in a Vuser script. At run time, a value from an external source is substituted for the parameter.

Parameterize Input data
During a run, VuGen replaces each parameter with a value from a data file or another external source, and inputs it to the Web application.

Why Parameterization?

Parameterization solves certain problems that may occur during playback

  •   Date constraints make recorded date invalid
  •   Unique constraints prevent reusing recorded data
  •   Data caching
  1.   Response times are inaccurate
  2.   Real user activity is not emulated
  3.   Servers are not exercised

Date Constraint

Problem

  •   Business process works only for the current date
  •   Vuser works only on the date it was recorded

Solution

  •   Parameterize the input date
  •   Use a Date Type parameter to make the Vuser work for any current date

Unique Constraint
Problem

  •   Some fields require a unique ID as in the case of a Primary Key or fields in database with Unique constraint
  •   How to measure the performance of the process which creates a new product?

Solution

  •   Parameterize the unique id fields
  •   After running, delete the test ID numbers from the system so the Vuser can   be run again
  • {mosgoogle}

Data is Cached

Problem

  •   Vusers all use the same data
  •   Data caching makes load test response times shorter than when real users  load the system

Solution
  Parameterize input data to force the system to get data from a database

How to create data pool?
  Extract master data from database

  •   Write queries on tables being accessed by the business transactions.
  •   Spool data to a file
  •   Write AWK scripts to generate a proper data pool from the spooled file

  Create valid transactional data

  •   Predict according to type of data
  •   Obtain from a functional expert

The Process

  •   Determine which fields to parameterize
  •   Replace recorded values with parameters
  •   Decide which parameter type to use
  •   Choose the data access method and the number of iterations
  •   Run the Vuser and analyze the results to verify correct execution

Parameterization – The Process

  1. Right click on the data to parameterize
  2. select “Replace with a Parameter”
  3. The Select or Create Parameter dialog box opens.
  4. Type a suitable Parameter Name
  5. Select a Parameter Type
  6. Right-click the parameter name and select “Replace More Occurrences” to replace the data by the parameter name.

 

Correlations

In applications output of the previous transaction is used as an input for the next transaction.
For example:

  •   System generated session ids
  •   URLs that change each time you access the Web page
  •   Fields (sometimes hidden) recorded during a form submission

The data is only good for the current session

Correlate the data

  1.   Capture output value from one step
  2.   Use captured value as input to another step

Correlated data is data which is sent to the client from the server, and later sent back to the server by the client

 

Dynamic data is correlated automatically by the client application (running in the browser) while recording a script

 

  •   Reusing recorded dynamic data will cause errors when you replay the script
  •   Recorded dynamic data must be recorrelated using parameters

Manual Correlation

  • Determine the value to capture
  • Find the right and left text boundaries of the value to capture
  • Find which occurrence of the text boundaries should be used
  • Add a web_reg_save_param function to the script, above the step which requests the page with the value to capture
  • Add the parameter name, left boundary, right boundary, and occurrence to the function
  • Parameterize the dynamic value in the script every time it occurs
  • Verify correct execution

Automatic Correlation

There are three types of automatic recording solutions

  • Auto-Detect Correlation
  • Rule-Based Correlation
  • Correlating All Statements
Rule Name
When to Use
Auto-detect Correlation
Detect and correlate dynamic data for supported application servers
Rule-Based
When working with a non-supported application server whose context is known.
Correlate All
Blindly correlate all dynamic data.

Auto-Detect Correlation
Automatically correlate the recorded statements, for application servers whose contexts

 

Correlating All Statements
VuGen correlates all statements

Rule-Based Correlation
Rule-based correlation requires correlation rules to be defined before recording a session 

About the Author

Leave A Response