web.loadCache

Load the Vuser cache from a file.

Syntax

web.loadCache( {object} );

JavaScript Object

{  
   stepName:"<string>",
   fileName:"<string>"
}
Property Name
Description
stepName
The label of the step in the Graphical Vuser script. Also used as the transaction name for automatic transactions.
fileName
The full pathname of the file to store the cache.

Return Values

Not applicable

Parameterization

You can use standard LoadRunner Professional parameterization with all string values in JavaScript objects.

General Information

web.loadCache restores the browser cache from a file. It is used together with web.dumpCache to implement Vuser persistent caching. The script always runs with the same initial cache.

The purpose is to capture the browser cache once while running the script manually. Then the same cache can be used repeatedly in tests. Using Vuser persistent caching improves CPU usage on the application and database servers.

After recording the script, add web.loadCache at the beginning and web.dumpCache at the end of either the action or vuser_end section, as appropriate to your test. Run the script once with the web.loadCache call commented out. Then uncomment the web.loadCache call and comment out the web.dumpCache call. The result is that on each run the cache you created is reloaded.

The filename path must point to the file saved with web.dumpCache. It is possible, however, to use a relative path where an absolute path was used to save, or an absolute path where a relative was used to save.

File names can be parameterized, so that different Virtual Users or different iterations use different files. For example, "filename=Iteration{param}.cache"

If the script is not developed on the machine that will be running the tests, ensure that the cache files are accessible to the host at the path given in filename.

Example

web.loadCache({name:"ActionLoad",
    fileName:"c:\\temp\\{VuserName}paycheck"
    });