如何在Jmeter中与HTTP请求同时请求AJAX(How to request AJAX concurrently with a HTTP request in Jmeter)

系统教程 行业动态 更新时间:2024-06-14 16:55:57
如何在Jmeter中与HTTP请求同时请求AJAX(How to request AJAX concurrently with a HTTP request in Jmeter)

在我们当前的测试计划中,我们请求包含AJAX的产品页面。 为了得到这个AJAX数据,我们使用一个xpath提取器,然后建立一个新的url路径并请求ajax。 问题是我们有一个恒定的吞吐量计时器,可以减慢这些请求的速度,实际上我们希望它们都能立即发生。 我们的测试计划如下 -

查看产品片段

-HTTP获取产品页面 - 建立AJAX请求 -HTTP获取AJAX信息

主测试文件 - 所有产品片段 恒定的吞吐量定时器(每分钟1个请求)

有什么方法可以从View Product Fragment中覆盖恒定吞吐量定时器吗?

我试过嵌套的控制器/定时器,但它们都不起作用。

In our current test plan we request a product page that contains AJAX. To get this AJAX data we use an xpath extractor, then build a new url path and request the ajax. The problem is we have a constant throughput timer which slows down these requests, when in reality we want them to all happen at once. Our test plan is as follows -

View Product Fragment

-HTTP Get Product Page --build AJAX request -HTTP Get AJAX information

Master Test File -Call Product Fragment -constant throughput timer (1 request per minute)

Is there any way to override the constant throughput timer from within the View Product Fragment?

I've tried nested controllers/timers but none of them seem to work.

最满意答案

您需要一个JSR223采样器或自定义采样器,它不会尊重JMeter线程组设置,并且能够使用它自己的线程池发出并发的AJAX请求。

有关实现细节,请参阅如何使用JMeter指导加载测试AJAX / XHR启用站点 。

You need a JSR223 Sampler or custom Sampler which won't respect JMeter Thread Group settings and will be able to fire off concurrent AJAX requests using it's own thread pool.

See How to Load Test AJAX/XHR Enabled Sites With JMeter guide for implementation details.

更多推荐

本文发布于:2023-04-10 11:26:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/1bcdf27c02a406ef7f95b42585a44d62.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中与   如何在   Jmeter   HTTP   request

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!