在 C# 中调用 web.url 时出现 LoadRunner AccessViolationException
在 C# 中使用 LoadRunner API (VUGEN 9.52.0.0) 调用 HTTP Get 的正确语法是什么?以下代码生成 AccessViolationException:
LoadRunner.WebApi web = new LoadRunner.WebApi();
web.url("GoToMyService", "http://path/to/my/service/", new string[0], "LAST");
调用 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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种选择是跳过使用 LoadRunner API 并仅使用 System.Net API,这并不真正符合 LoadRunner 的精神:
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:
对于性能测试人员来说,你正在从事一种有道德问题的活动:你不会用上膛的枪指着你不拥有、管理或控制的东西。 LoadRunner 是一把上了膛的枪,我~~~假设~~你不为谷歌工作。所以,只是不要
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