Reputation: 401
Using JMeter, I'm trying to test my Application Performance.
This is the first time I'm digging JMeter. So if any technical words missing, please let me know.
So going to my query,
Our application needs authentication to access any request except Login and Registration.
My Test Plan is like above.
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)
Now What I need is,
1) Generally, when the response received, the user reads the content. For some response are large, some are less. So reading time for content depends on content size.
Same thing I want to implement in JMeter. When Dashboard response received, wait 3 seconds(I'll specify the different time for different Req's) and then call next random HttpRequest.
I try with Http Request--> Constant Timer. But it working before request (reverse: before invoking request, wait specific time).
So is there any Timer help for my test plan design?
Also, I think about BeanShell Post processor may help. But not found anything.
Upvotes: 1
Views: 6467
Reputation: 13960
I see 2 options here:
Use Controller, Test Action, and Timer, as described here. I.e. set Transaction Controller as a parent to Dashboard Request. Add Test Action under the same controller with constant or variable pause to simulate delay:
Random Controller
Transaction Controller
Dashboard Request
Test Action
Other HTTP Request
Use BeanShell, or any other programmable post-processor and the power of the corresponding language to pause. For example with BeanShell post-processor you can
Thread.sleep(3000); // pauses for 3 sec. after request
Second solution is seems shorter and faster. But semantically first expresses the intent better.
Upvotes: 1