1

What's the correct syntax to invoke a HTTP Get using the LoadRunner API (VUGEN 9.52.0.0) in C#? The following generates an AccessViolationException:

LoadRunner.WebApi web = new LoadRunner.WebApi();
web.url("GoToMyService", "http://path/to/my/service/", new string[0], "LAST");

Exception thrown by call to web.url:

Error: Action.cs(25): System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at LoadRunner.WebApiClass.url(String name, String urladdr, Object options, Object extrares)
   at Script.VuserClass.Action() in h:\Personal\_projects\LoadTest\Action.cs:line 25
Iain
  • 10,433
  • 16
  • 56
  • 62

2 Answers2

0

One option, which isn't really in the spirit of LoadRunner, is to skip using the LoadRunner API and just use the System.Net APIs:

WebResponse response = HttpWebRequest.Create("http://path/to/my/service/").GetResponse();
Iain
  • 10,433
  • 16
  • 56
  • 62
-1

You are engaging in an ethically problematic activity for a performance tester: You do not point a loaded gun at something that you do not own, manage or control. LoadRunner is a loaded gun and I am ~~~assuming~~ you don't work for google. So, just don't

James Pulley
  • 5,606
  • 1
  • 14
  • 14
  • Don't worry. Worth being clear that I'm not actually running load tests against google.com. In my example code I just replaced the URL for the service I'm developing with something more generic. I have removed my reference to google.com anyway :-) – Iain Oct 27 '11 at 12:34