JMeter - Test not running on second call at run time - jmeter

I have set my tests up in the following layout:
Test Plam
Test Fragment
EP-1(include controller)
EP-2(include controller)
EP-3(include controller)
Thread Group
Parameterized controller
Module Controller
EP1
Parameterized controller
Module Controller
EP2
Parameterized controller
Module Controller
EP1
Parameterized controller
Module Controller
EP3
View Results Tree
Results:
EP1
EP2
EP3
When running these tests i only get EP1 running once and doesn't run a second time (doesn't even look like it attempts to run)
No information in JMeter log apart from loaded (include controller)
I added the HTTP request directly and have the same issue so did the following set up:
Test Plan
Test Fragment
EP-1(include controller)
EP-2(include controller)
EP-3(include controller)
Thread Group
Parameterized controller
EP1
Parameterized controller
EP2
Parameterized controller
EP1
Parameterized controller
EP3
View Results Tree
Still got the same result. Any ideas?
New:
OUTPUT of this is:
JWT Token
Include Controller1 (PUT)
Include Controller2 (GET)
HTTP Request (PUT)
Include Controller1 (PUT)
HTTP Request (GET)
Include Controller1 (PUT)
Expected:
JWT Token
Include Controller1 (PUT)
Include Controller2 (GET)
HTTP Request (PUT)
Include Controller1 (PUT)
Include Controller2 (GET)
HTTP Request (GET)
Include Controller1 (PUT)
HTTP Request (GET)
Include Controller2 (GET)

I cannot reproduce your issue using latest stable JMeter 5.2.1 and your test plan structure with simple single Dummy Samplers under the Test Fragment in the each included file.
I configured the included Samplers to display current Thread Group iteration using __threadGroupName() and __V() functions combination like:
${__V(__jm__${__threadGroupName}__idx,)}
and as you can see everything is executing just fine:

Turns out the Cache Manager was caching the (GET) request (checkbox)
unchecked that and it worked.
Hopefully this helps anyone having a moment when writing these tests and unable to work out why the following (GET) requests are not being excuted.

Related

Forward request to another controller in spring

I want to forward request coming to controller /deeplink to /gateway.
Is there any way to do this using the response object like response.sendRedirect is there for redirects? I don't want to return "forward:/url" from my controller as that would require a lot of code change in our legacy codebase
Will forwarding call all the filters as well?

JMeter SMTP Sampler not triggering on Failure

I have created a Thread Group and have 2 test sampler - Create Service and Create Project. I have added an SMTP Sampler to this Thread group and added an IF Controller with this script !${JMeterThread.last_sample_ok} But this SMTP Sampler is not triggering when I run the Thread group and there is a failure on Service Creation. what am I doing wrong here
If Controller expects the "condition" to be true or false, what you put resolves into !true hence it doesn't fire.
I would suggest considering switching to __jexl3() function like:
${__jexl3("${JMeterThread.last_sample_ok}" == "false",)}
More information: 6 Tips for JMeter If Controller Usage

Cypress: Test non-XHR request caused by submitting POST form

I am testing Vue application. In some cases my application have to submit(not just after click submit button but programmatically) POST form and redirect to 3rd party server with some body parameters. Like in best practice written I am trying to avoid of using redirect to real server.
For my certain test it will be sufficient to just make sure that request was sent with certain parameters, but I don't now how to catch this body request parameters for assertion, because cypress does not allow to stub non-XHR requests and I can't do like this:
cy.route('POST', '/posts').as('post')
cy.get("#post").should(req => {
// check body params
});
I also thought about stub vue component method to intercept form submitting, but it only seems to work with global objects like Math.
I truly appreciate any new ideas how to test functionality like this.
Since Cypress 5.1 you can stub other requests type using cy.route2()(https://docs.cypress.io/guides/references/changelog.html#5-1-0).

Jmeter Module Controller - Response Assertion Ignored

In a test Fragment add a Simple Controller
In the Simple Controller Add add a request
In a Module Controller reference that simple controller
Add a Response Assertion within the module
The Response Assertion is Ignored.
Is this a normal behavior ? If yes, you shouldn't be able to add a Response Assertion.

Jmeter Clear cookies after each http request

In jmeter context, is there any way to clear cookies after each http request within the same thread group?
Why in that case you need HTTP Cookie Manager at all? Just remove it and you'll get expected behaviour.
Just in case you have some form of weird negative test scenario:
Add a Beanshell Listener or Beanshell Assertion at the same level with all HTTP Request samplers
Put the following code into "Script" area
import org.apache.jmeter.protocol.http.control.CookieManager;
CookieManager manager = ctx.getCurrentSampler().getProperty("HTTPSampler.cookie_manager").getObjectValue();
manager.clear();
See the following reference material:
JMeterContext class JavaDoc (referenced as ctx in the above script)
CookieManager class JavaDoc
How to Use BeanShell: JMeter's Favorite Built-in Component

Resources