Group Samplers between a GET and a DELETE Sampler - testing

I'm using JMeter Proxy Server to record series of HTTP requests from a program and JMeter has already transform these HTTP requests to samplers for me. However, I want to group the samplers that are in-between a GET and a DELETE sampler.
To illustrate, the structure of my test plan generate by JMeter is similar to this. However, there are thounsands of requests and their method is not written on their name.
- Test plan
-- Recording Controller
--- GET Sampler1
--- POST Sampler2
--- DELETE Sampler3
--- GET Sampler4
--- POST Sampler5
--- DELETE Sampler6
Is there a way automatically or semi-automatically arrange the test plan into this structure:
- Test plan
--Recording Controller
--- Group1
---- GET Sampler1
---- POST Sampler2
---- DELETE Sampler3
--- Group2
---- GET Sampler4
---- POST Sampler5
---- DELETE Sampler6
where every sampler are group between a GET and a DELETE Sampler?

Press Ctrl + Left Mouse Click on Samplers you want to group
Right Mouse Click -> Insert Parent -> Logic Controller -> Choose Controller

Related

What is page.reload([options]) in Playwright?

I couldn't find any detail explanation about the page.reload() method in Playwright. Is there anyone who can explain it to me in detail? Thanks!
Am I correct?
1. page.reload() --- just reload the webpage
2. page.reload(timeout=0) --- reload the webpage, disable timeout
3. page.reload(timeout=30000) --- reload the webpage, timeout = 30 seconds
4. page.reload(waitUntil='load') --- reload the webpage until consider operation to be finished
5. page.reload(timeout=0, waitUntil='load') --- .......

JMeter , Execution order is not correct

I have 4 transaction controllers named
Trans_api1
__Http Request
Trans_api2
__Http Request
Trans_api3
__Http Request
Trans_api4
__Http Request
that contain Http Requests, However when I run my test plan, I want them to run in numerical order but then they run randomly. How do I fix the order to it runs from 1-4?
Each JMeter thread (virtual user) runs Samplers upside down so you don't need to do anything, your requests are executed from top to bottom already. If you run your test with 1 user - you will see that requests are being executed sequentially.
If you're seeing some "mess" most probably it's caused by concurrency, like
1st user starts 1st request
2st user starts 2nd request
2nd user starts 1st request
1st user starts 3rd request
etc.
You can see this yourself if you add ${__threadNum} function as the prefix or postfix for your request (or transaction controller) label and eventually ${__groovy(vars.getIteration(),)} function to display the current loop number
With 1 user:
With 2 users:
With 2 users and 2 iterations:
As it evidenced by the above images each users executes samplers sequentially on each iteration, these "inconsistencies" are misleadingly interpreted due to concurrency
See Apache JMeter Functions - An Introduction article to get familiarized with JMeter Functions concept

Jmeter How to make 2 thread group run parallel but not sharing parameter value between thread?

I have a situation like this:
Test Plan
Thread Group 1
var A = 1 ( User parameters)
HTTP request 1
HTTP request 2
Thread Group 2
var A = 2 ( User parameters)
HTTP request 3
HTTP request 4
I know that I can use "Run Thread Groups consecutively" to make these 2 thread run parallel. However, the problem is, because they are running parallel, sometimes var A=2 got recognized in Thread Group 1, and thus make the test case fail. What I ask, is there any way that I can still run these threads parallel and still make sure that the parameter values of these threads won't affect on each other? Thank you!
You can use different name for the variable so that there is no conflict.
Something like below:-
Test Plan
Thread Group 1
var A = 1 ( User parameters)
HTTP request 1
HTTP request 2
Thread Group 2
var B = 2 ( User parameters)
HTTP request 3
HTTP request 4
From the jmeter documentation:-
If you have more than one Thread Group, make sure you use different
names for different values, as UDVs are shared between Thread Groups.
Also, the variables are not available for use until after the element
has been processed, so you cannot reference variables that are defined
in the same element. You can reference variables defined in earlier
UDVs or on the Test Plan.
Hope this helps.
This is not possible as JMeter Variables scope is limited to current Thread Group only so the situation where 2nd Thread Group is reading the values from 1st Thread Group User Parameters element is either a bug in JMeter or your test fails for a different reason. For example not having a User Parameters element in 2nd Thread Group I'm not getting anything as the variable value:
I would recommend double checking expected variable A values using Debug Sampler and View Results Tree listener combination, perhaps your configuration is vague.

JMeter order of samples with Redis Data

I am using Redis Data Set as a data source in my JMeter tests. I have configured the redis key with a value I retrieve from a JSR223 sampler.
Below are my test samplers.
in the bove JSR223 sampler I retrieve a previous value ${operator} and put in to properties.
Then in the next sampler ,
I reuse the value as ${__P(operator)}.
The issue with this is ,it doesn't look like JSR233 sampler is running before jp#gc RedisDataset. so the script fails like below.
Stop Thread seen for thread XXXXXX 1-1, reason: org.apache.jorphan.util.JMeterStopThreadException: End of Redis data detected, thread will exit
If I run the script once commenting the Redis data set sampler, and run on a second run with enabling it, the value can be seen, as the value have been stored in the Jmeter memory, this way it was evident that Redis data set runs before JSR223 sampler. I can not move JSR 233 sampler out of the test fragment to a much higher level as I need to run it within the test fragment.
Is there a location which defines these order of executions with Redis samplers ?
Or is there a way to define the order in Jmeter so that JSR223 will run before Redis sampler?
===================================
UPDATE 1
After #Dmitri-t s reply, I have updated the project as follows .
and
As per Execution Order chapter of JMeter User Manual:
0. Configuration elements
1. Pre-Processors
2. Timers
3. Sampler
4. Post-Processors (unless SampleResult is null)
5. Assertions (unless SampleResult is null)
6. Listeners (unless SampleResult is null)
Redis Data Set is a Configuration Element therefore it will be executed prior to anything else.
The only way you can make this operator property dynamic is overriding it via -J command-line argument like:
jmeter -Joperator=something -n -t test.jmx -l result.jtl
I got That working in the following way
TestPlan
|--Thread group
|--Module Controller -1
| |--CSV Data Set Config - to load operator name(this is going to be reused in other thread groups)
|--Module Controller -2
|--JSR233 Sampler - To read a second level file with ${operator} in its name
|--For Each Controller - to read through the second level file
| |--User Defined Variables - to split the line from the second level file in to variables
|--HTTP Request - Action sampler with ${operator} and other variables
Ref : Iterating over a csv file

Need to execute all while controller under the test plan in jmeter

view results treei'm using below schema in my test plan but only the first while controller with csv dataset gets executed.For the last 2 while controller there is no action
Test plan
-------------->thread group
---------->while controller 1
|___>csv data set 1
---------->while controller 2
|___>csv data set 2
---------->while controller 3
|___>csv data set 3
while controller is used in my test is to execute csv data set with one thread
i want jmeter to execute all while controller present in the test plan
Jmeter version 2.11
Thanks in advance!
I suggest
add a "debug sampler" and make its Name "Debug:
${your while condition} Then you can really see exactly what the
value of your while condition is at the critical moment.
Give us a screen shot of your "view results tree" it is possible
you are hitting an error and your thread is configured to stop on
the first error
That should at least give some more info in the situation