Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JMeter:在响应特定的HttpRequest之后,等待3秒钟调用下一个请求_Jmeter - Fatal编程技术网

JMeter:在响应特定的HttpRequest之后,等待3秒钟调用下一个请求

JMeter:在响应特定的HttpRequest之后,等待3秒钟调用下一个请求,jmeter,Jmeter,使用JMeter,我试图测试我的应用程序性能 这是我第一次挖JMeter。因此,如果缺少任何技术词汇,请告诉我 那么我的问题是 我们的应用程序需要身份验证才能访问除登录和注册之外的任何请求 我的测试计划如上所述 A) Login Request (It should be call for every user first, then only (2) will perform) 1) based on credential in CSV file (Working) 2

使用JMeter,我试图测试我的应用程序性能

这是我第一次挖JMeter。因此,如果缺少任何技术词汇,请告诉我

那么我的问题是

我们的应用程序需要身份验证才能访问除登录和注册之外的任何请求

我的测试计划如上所述

A) Login Request (It should be call for every user first, then only (2) will perform)
    1) based on credential in CSV file    (Working)
    2) Post processing using BeanShell Post processor (Working)
    3) Store token and user id in variables for Next request (Working)
    4) The token will be sent through Every HttpRequest Header (Working)

B) Random Controller
   1) List of HttpRequest's 
        invoke HttpRequest randomly (Working)
   2) For Dashboard Request, after the getting the response, sleep 3 seconds and continue the flow. (only this thread will wait)
现在我需要的是

1) 通常,当收到响应时,用户读取内容。因为有些响应很大,有些响应较小。因此,内容的阅读时间取决于内容大小

我想在JMeter中实现同样的东西。当收到仪表板响应时,等待3秒钟(我将为不同的Req指定不同的时间),然后调用下一个随机HttpRequest

我尝试使用Http请求-->常量计时器。但它在请求之前工作(相反:在调用请求之前,等待特定的时间)

那么,我的测试计划设计是否有计时器帮助

此外,我认为BeanShell后处理器可能会有所帮助。但是没有找到任何东西。

我在这里看到两个选项:

  • 如前所述,使用控制器、测试动作和计时器。 即,将事务控制器设置为仪表板请求的父级。在同一控制器下添加测试动作,以恒定或可变暂停模拟延迟:

     Random Controller
       Transaction Controller
         Dashboard Request
         Test Action
       Other HTTP Request
    
  • 使用BeanShell或任何其他可编程后处理器和相应语言的功能暂停。例如,使用BeanShell后处理器,您可以

    Thread.sleep(3000); // pauses for 3 sec. after request
    

  • 第二个解决方案似乎更短更快。但是首先在语义上更好地表达意图。

    Oh。。与测试动作一起工作。谢谢你,基里尔。你提到的博客()非常有用。多亏了维克多·克列皮科夫斯基