需要调试录制的jmeter脚本

发布于 2024-09-24 20:31:07 字数 509 浏览 3 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

错々过的事 2024-10-01 20:31:08

听起来 Jmeter 没有执行 AJAX 调用,这可能没问题,具体取决于您的站点。您可以简单地执行 HTTP 请求来获取 AJAX 调用填充的页面吗?

我建议阅读这篇文章,因为它看起来不错。

我见过这种情况是由以下几个原因引起的:

  1. 在发出失败的请求之前需要加载并缓存页面;
  2. 失败的页面需要自动重定向才能正常工作;
  3. 失败的页面有 JMeter 无法记录的子请求。开发人员可以为此提供帮助。

希望这有帮助。

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:

  1. a page is required to load and be cached BEFORE making the failing request;
  2. the failing page needs to automatically redirected to work properly;
  3. the failing page has sub-requests JMeter failed to record. Devs can help with this.

Hope this helps.

末が日狂欢 2024-10-01 20:31:07

我要做的第一件事是确定 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文