Jmeter Module Controller - Response Assertion Ignored - jmeter

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.

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?

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 - Test not running on second call at run time

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.

Parameter format issue with ASP.NET Web API controller

I am watching this pluralsight demo video on Web Api, and he is using fiddler to pass in a parameter using Http Get with the syntax of controller/parameter
So he's using http://localhost:2405/api/values/5
5 Is the parameter he's passing in.
In my code, I have everything set up exactly the same way he does... with a routing template of {controller}/{id} and a controller method with a signature of
public string Get(string zipcode)
I can pass a parameter just fine with http://localhost:2405/api/values?zipcode=25252 but if I try passing in a paramter the way he does, like http://localhost:2405/api/values/25252 I get an error saying I do not have an action available to handle that request on the controller.
What is he doing right, that I'm doing wrong?
You need to change your routing template to {controller}/{zipcode} as the name of the parameter must match the name in the template.

Grails Canoo Webtest plugin: invoke() fails to send JSON data in POST request

I'm evaluating Canoo Webtest for automated integration/functional testing as a Grails plugin.
I have a REST app which I'm attempting to test, but Canoo Webtest doesn't seem to properly send the JSON data in POST request. My test code is like below
invoke( description:"Add a product to shopping cart",
url:'shoppingCart/add', method:'POST',
content:'{"class":"shop.service.Product", "name":"A product", "description":"Manufactured by X", "price":99.9}'
//contentFile: '../product.json'
)
The request body is empty no matter whether I use contentFile approach or inline the data as content attribute. The test report shows the data as being sent correctly, but error page shows an error stating 'JSONException: Missing value. at character 0 of '. JSON data as a response of GET request is coming back fine.
I have tested the same functionality with curl and it works perfectly fine. Is there something I'm missing in the Canoo Webtest setup?
Thanks.
EDIT: I'm using Grails 1.3.7 in case that makes any difference
OK. I started to just experiment with the invoke() and seems that setting attribute soapAction value to true does the trick.
I have no clue why this works. The documentation of invoke() for the attribute says
soapAction
Required? no
If the HTTP method is POST and is in fact a SOAP POST request,
this allows the SOAP Action header to be set. Ignored for GETs.
Apparently it sets some needed request header. Haven't checked which one.
Thank you for reading :)
Cannot yet mark this answer as the correct one, but will do so when it's possible.

Resources