cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to build communication with REST interface using LoadRunner

meng_yu
Guide

I recently had a question on how to get through the REST Interface authentication within LoadRunner Scripts. Or in general, what we can do about automating LoadRunner tests by taking advantage of the REST interfaces?

Thanks,

Meng

2 REPLIES 2

wolfgang_gottes
Dynatrace Helper
Dynatrace Helper

Hi,

dynaTrace uses basic auth for its REST interfaces - I'm not an expert in LoadRunner, but I assume you could specify the credentials somewhere when making the call? As a last resort, you could also put the user and password in the URL when making the REST call - like http://admin:admin@localhost:8020/rest/management/profiles/<profile>/startrecording

In terms of automating LoadRunner tests: The most common use case probably is starting and stopping recording on the dT server to store a session for the duration of the load test. Could you maybe elaborate on what automation you have in mind?

Thanks,

Wolfgang

I want to answer my question here. Tasks you could do with LoadRunner through REST interfaces (credits to my customer)
  1. At the very beginning of our test, flip the system profile to enable the bind value; Then at the very end, flip it back to disable bind value. 
  2. If I have to troubleshoot a certain functionalities of an application, I might insert a specific dynaTrace request right before and/or after this specific functionality, such as create memory dump, start CPU sampling, enable custom measure, etc. 
  3. Embed dynaTrace into LoadRunner report
  4. Generate report right after my test is completed
  5. Save session automatically when my test ended

Before achieving those goals, you will need to first of all build communication with REST interfaces by

1. Use a LoadRunner function (e.g. web_set_user( "{Username}", "{Password}", "{Domain}:8000" ))  http://ptfrontline.wordpress.com/2009/12/23/loadrunner-http-401-authentication/

2. Make password encrypted using LoadRunner Password Encoder and lr_decrypt()

http://www.myloadtest.com/loadrunner-password-encryption/