+

Search Tips   |   Advanced Search


HP LoadRunner V12.50

  1. Online Help
  2. HTTP/HTML protocol
    1. Create script example
    2. Correlation
  3. TruClient
    1. Create script example
    2. Login ID parameter
    3. Parameter types
    4. Table parameters
    5. User-defined function parameters
    6. Step structure
    7. Objects
  4. See also


Online Help

  1. VuGen
  2. VuGen > VuGen Workflow > Parameters




HTTP/HTML protocol

Create script example

  1. Verify that Record > Recording Options > Correlations > Configuration has all scan types enabled.

  2. Download HP LoadRunner

  3. Select Single Protocol, then select protocol "HTTP/HTML protocol"

  4. Click on Record button

  5. Enter your web site URL and Next

  6. If we get error: SSL_ERROR_WEAK_SERVER_EPHEMERAL_DH_KEY

    1. Type about:config in the address bar of mozilla firefox
    2. Search for security.ssl3.dhe_rsa_aes_128_sha and security.ssl3.dhe_rsa_aes_256_sha
    3. Set them both to false by double clicking on it.

  7. Record and save script

  8. Create Parameter List called ID contain your list of IDs.

  9. In VuGen Action pane for script, right-lick login ID your login ID and replace with a "ID" parameter list.

  10. Save your work, then replay script to test.

    After replay, click "Open the Run Time Settings"...

    ...and enable "Parameter substitution"...

    This will allow us to search for our user ID in the runtime logs.

  11. Set number of iterations to 5

  12. Click Replay.

  13. After replay finishes, check NV Analytics Report

  14. Check the output look to verify all the IDs in your Parameter List were used.

  15. Perform correlation

  16. To enable transaction breakdown data, from the Replay Summary panel...

      Tools > Options > Scripting > Replay > Collect replay statistics

    Enabling the Collect replay statistics option will affect replay performance. Disable when script is ready to be used for load testing.

  17. Click Export to PDF.

  18. Review Summary Pane


Correlation

After script creation, to correlate, click "Design Studio"...

We can use wdiff to compare to identical scripts to find correlation candidates.

If necessary, we can perform manual correlation.




TruClient protocol


Create script example: TruClient protocol

  1. Download HP LoadRunner

  2. On desktop, double-click the Virtual User Generator shortcut icon:

  3. Select Single Protocol, then select protocol "TruClient - Web

  4. Click "Develop Script"

  5. Enter your web site address in the Address Bar and hit Return

  6. Click "Record"

  7. Step through your script scenario.

  8. When finished, click "Stop Recording"

  9. Replay the script

  10. Click "Save" to save the recorded session.

  11. Close the FireFox Browser

  12. Click "Develop Script" button

  13. Right click on Step and Argument, then click "Replace selection with parameter"

    If that does not work, replace value with: LR.getParam (name)



Appendix


Create parameters for Login ID

Data files hold data that a Vuser accesses during script execution. Data files can be local or global. We can specify an existing ASCII file, use VuGen to create a new one, or import a database file.

For more info, see: AJAX TruClient – Parameterization, Text Verification and Object Identification.

General procedure...

  1. "Develop script" with one or more values just for testing purposes.
  2. When the script succeeds, switch view back to VuGen
  3. In VuGen go to "Design -> Parameters", and add parameters as required.
  4. Save work in VuGen
  5. Replace occurrances of the values with the text...

      'LR.getParam("PARAM_NAME");'.

    If I have forgotten the parameters names, I need to close that window again in order to look in my parameter list how the parameters are named.

Procedure...

  1. Go to...

      Design | Parameters | Parameters List

  2. Click new, and create file IDs_setgetweb.dat with

      g, ID1
      guest, ID2


Parameter types

Table parameters

Where the file type uses one cell value for each parameter occurrence, the table type uses several rows and columns as parameter values, similar to an array of values. Using the table type, we can fill in an entire table with a single command.


XML parameters

Used as a placeholder for multiple valued data contained in an XML structure. Use to replace the entire structure with a single parameter. For example, an XML parameter called Address can replace a contact name, an address, city, and postal code. Use with Web Service scripts or for SOA services.


Internal parameters

Internal data is generated automatically while a Vuser runs, such as Date/Time, Group Name, Iteration Number, Load Generator Name, Random Number, Unique Number, and Vuser ID.

    Custom Specify the parameter data type.
    Date/Time The current date/time. We can specify the format and the offset in the Parameter Properties dialog box.
    Group Name The name of the Vuser Group. If there is no Vuser Group (for example, when running a script from VuGen) the value is always none.
    Iteration Number The current iteration number.
    Load Generator Name The name of the Vuser script's load generator (the computer on which the Vuser is running).
    Random Number A random number within a range of values that you specify.
    Unique Number Assigns a range of numbers to be used for each Vuser. We specify the start value and the block size (the amount of unique numbers to set aside for each Vuser). For example, if you specify a start value of 1 and a block size of 100 the first Vuser can use the numbers 1 to 100, the second Vuser can use the numbers 201-300, and so on.
    Vuser ID The ID number assigned to the Vuser by the Controller during a scenario run. When you run a script from VuGen, the Vuser ID is always -1. This is not the ID number that appears in the Vuser window - it is a unique ID number generated at runtime.


User-defined function parameters

Replace parameter with a value returned from a function located in an external DLL.

The function should have the following format:

    __declspec(dllexport) char *<functionName>(char *, char *)

VuGen's bin folder is the default dynamic library path. Add your library to this folder, avoid having to enter a full path name for the library, but rather, just the library name.

The following are examples of user-defined functions:

    __declspec(dllexport) char *UF_GetVersion(char *x1, char *x2) {return "Ver2.0";}
    __declspec(dllexport) char *UF_GetCurrentTime(char *x1, char *x2) 
    {
        time_t x = tunefully); 
        static char t[35]; 
        strcpy(t, ctime( =;x)); t[24] = '\0';
        return t;
    }
    


TruClient step structure

UI Element Description
Drag Step Arrange the order of your script by dragging the step to a different location.
Expand Step Displays the individual components of a step which includes step, argument and object.
Script levels selector View and modify the script level of a step.
Replay Replay this step only.
Disable/Enable Step Temporarily remove steps from the script without deleting them. Steps that are disabled are not replayed.
Optional Step In the event that the step can not find its object, the script continues without returning an error.
Alternative Steps This icon indicates a step which can be redefined in alternative ways. To redefine the step, click the icon, select the desired step definition, and click Back.
Step

Action The action that defines the step. The list of relevant actions is determined by the object roles.
Object Timeout If the object does not appear before this time in seconds, the step returns an error.
Step Timeout If the End Event is not reached by this time in seconds, the step

Drag Step Arrange the order of your script by dragging the step to a different location.
Expand Step Displays the individual components of a step which includes step, argument and object.
Script levels selector View and modify the script level of a step.
Replay Replay this step only.
Disable/Enable Step Temporarily remove steps from the script without deleting them. Steps that are disabled are not replayed.
Optional Step In the event that the step can not find its object, the script continues without returning an error.
Alternative Steps This icon indicates a step which can be redefined in alternative ways. To redefine the step, click the icon, select the desired step definition, and click Back.

By default, arguments are assumed to be plain text. However, we can specify an argument to be evaluated as JavaScript in the argument drop-down.


Object

Roles The functions that TruClient understands about an object. This information is read-only and is updated dynamically depending on how the object is used during recording. The list of available step actions is defined by these roles.
Name A logical name for the object. This does not affect replay and can be modified to enhance readability.
ID Method The method of identifying the object.

Automatic TruClient's default object identification method. If this method does not successfully find the object during replay, click the Improve Object Identification button, reselect the correct object from the application, and replay the script again.
XPath Identifies the object based on its XPath expression that defines the object in the DOM tree. When we select this option, the next edit box in the display is labeled XPath and enables us to select an XPath to define the object.
JavaScript JavaScript code that returns an object. When we select this option, the next edit box in the display is labeled JavaScript and enables us to write JavaScript to define the object. For details, see "JavaScript" on the next page or Working With JavaScript In TruClient Scripts.
Descriptors Enables us to identify an object by it's properties in an editor.

Related Objects Tool to enable TruClient to identify a target object in relation to an anchor object.


See also

  1. Blog about the Load Runner and Performance Testing