需要调试录制的jmeter脚本
我最近在 Jmeter 中记录了一个测试脚本,旨在用作负载测试脚本(使用这个方便记录本身效果很好,我什至弄清楚了如何获取和参数化会话 ID 和时间戳,但是,如果我按照记录的方式运行记录的步骤,其中一些将不起作用 - - 他们生成“500--服务器遇到内部错误...嵌套异常是 java.lang.NullPointerException” 如果我复制请求 GET 调用(请求选项卡、ViewResultsTree),则失败的步骤都是填充侧边栏元素的 Ajax 调用。将其粘贴到浏览器中我得到完全相同的错误。我是否需要以不同的方式记录我的脚本,或者手动编码 ajax 调用?其他早期步骤可以正常工作并发送预期的 POST 数据,因此它不是下面的应用程序测试或忘记代理设置。目前正在 Firefox 3.6.10 上运行。
任何有关如何调试此问题的建议将不胜感激。
I recently recorded a test script in Jmeter intended for use as a load test script (using this handy set of instructions. The recording itself worked great and I even figured out how to grab and parametrize the session ids and timestamps. However, if I run the recorded steps just as they were recorded some of them don't work -- they generate "500--Server encountered and internal error ...nested exception is java.lang.NullPointerException" The failing steps are all Ajax calls that populate sidebar elements. If I copy the request GET call (Request tab, ViewResultsTree) and paste it into a browser I get the exact same error. Do I need to record my script differently, or hand-code the ajax calls? Other, earlier steps work correctly and send the expected POST data, so it isn't the application under test or forgotten proxy settings. Currently running against Firefox 3.6.10
Any suggestions on how I can debug this would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来 Jmeter 没有执行 AJAX 调用,这可能没问题,具体取决于您的站点。您可以简单地执行 HTTP 请求来获取 AJAX 调用填充的页面吗?
我建议阅读这篇文章,因为它看起来不错。
我见过这种情况是由以下几个原因引起的:
希望这有帮助。
It sounds like Jmeter isn't executing the AJAX calls, and this can be fine depending on your site. Can you simply do an HTTP request to get the pages the AJAX calls populate?
I would recommend reading this post, as it looks pretty good.
I've seen that situation caused by a few things:
Hope this helps.
我要做的第一件事是确定 java.lang.NullPointerException 是发生在客户端 (JMeter) 还是服务器上。如果它发生在 JMeter 中,则说明您的脚本或 JMeter 出现了严重错误。
但假设您的服务器上遇到了错误,那么调查异常原因可能会揭示 JMeter 发出的请求出了什么问题。您是否有权访问引发异常的代码?
我还建议将记录中的请求与生成错误的请求进行比较。您可能需要确定请求的哪些部分是特定于会话的,并确保正确填充这些字段。
The first thing I'd do is determine if the java.lang.NullPointerException is happening on the client side (JMeter) or on your server. If it is happening in JMeter, than something is terribly wrong with either your script or with JMeter.
But assuming that the error is encountered on your server, then looking into the cause of the exception may shed light on what is wrong with the request issued by JMeter. Do you have access to the code where the exception is thrown?
I would also recommend comparing the request in the recording with the request that generated the error. You may need to determine which parts of the request are session-specific and ensure those fields are populated correctly.