1

Folks, I patched my script by adding the AddDynatraceHeader to each web call but when I try to run it says its not recognized, maybe a missing library, Im running LR 11.5

thanks

centic
  • 15,565
  • 9
  • 68
  • 125
Im Rick James
  • 255
  • 3
  • 15

4 Answers4

1

Did you see the doc page on Dynatrace Load Runner Integration? We have a script conversion tool which will also add that method to your header files.

Andreas Grabner
  • 645
  • 3
  • 7
1

I needed to add the addDynatraceHeader function in the Globals.H file, ussually this is automatically done by Dynatrace on the Patch LoadRunner script utility.

Im Rick James
  • 255
  • 3
  • 15
0

It would help if you could note the code which is failing and then check to see if a given API is included in your version of LoadRunner

James Pulley
  • 5,606
  • 1
  • 14
  • 14
-1

I added this to globals.h file and it worked for me.

void addDynaTraceHeader(char* header){
    char* headerValue;
    int headerValueLength;
    int vuserid, scid;
    char *groupid, *timestamp;
    char* vuserstring=(char*) malloc(sizeof(char) * 10);

    web_save_timestamp_param("TimeStamp", LAST);
    timestamp=lr_eval_string("{TimeStamp}");

    lr_whoami(&vuserid, &groupid, &scid);
    itoa(vuserid,vuserstring,10);

    headerValueLength = strlen(header) + 4 + strlen(vuserstring) + 4 + strlen(timestamp) + 1;
    headerValue = (char*) malloc(sizeof(char) * headerValueLength);
    strcpy(headerValue, header);
    strcat(headerValue,";VU=");
    strcat(headerValue,vuserstring);
    strcat(headerValue,";ID=");
    strcat(headerValue,timestamp);

    web_add_header("X-dynaTrace", headerValue);
    free(headerValue);
    free(vuserstring);
}
  • I am very new to loadrunner but I guess, because I installed Dynatrace and patched my script with it, the given code was added to my global.h file. Now if I replay the script, VUGen is able to find the definition of addDynaTraceHeader and execute it successfully. The script should also work with ALM and Performance center. – Praveen Tata Dec 20 '17 at 19:40