Handling Callback URLs in JMeter - jmeter

My REST Service takes in a JMeter HTTP request and one of the parameters in the request is a callback url.
The REST Service uses this callback url to post back a response.
Is there any JMeter Listener I can use to receive the callback i.e. so that the REST Service can send the response back to a JMeter Listener.
And if possible the Listener can then send in another HTTP Request based on the response.

I'm not sure about your question. But I think you want to receive your REST response and make another request to URL in the response...
By that way, you need to "catch" the response by using Regular Expression Extractor, store URL in the response to a JMeter Variable. Then, you create HTTP Request, and put URL in that JMeter Variable into request.

Related

How to handle callback return response in Jmeter

In my REST POST/PUT request I will send callback url with additional data
Once backend server responded with success or failure, i will get response to my callback url.
How can see what response in callback url in Jmeter. Based on response I process further
If this is a 3rd-party URL there is no possibility to intercept the request from your backend to this callback URL with JMeter
If you can change the callback URL to an arbitrary value you can use i.e. HTTP Mirror Server as the callback URL, this way your backend will send the request to JMeter instead of the 3rd-party URL so you will be able to get the status and eventually re-send the request to the callback URL so it won't be lost.
If this is not possible you can investigate where the information about the job status is stored, if it can be found in a log file you can use OS Process Sampler or SSH Command sampler to get it, if it's in the database - you can retrieve it using JDBC Test Elements, etc.

Post Request getting failed due to webkitformboundary in JMeter

We have a recorded script using Blaze Meter(HTTPS call) and run in JMeter, One POST request getting failed and shows "500 Internal Server error". In Post request, JSON passed in form of "form-Data" as parameter. When endpoint executed we observed Webkitformbounday in HTTP header, Please give some solution for
HTTPs Request
HTTP Header Manager
POST Request Body
enter image description here
It looks like the recording solution you're using isn't very suitable for building proper HTTP POST request, I would suggest the following amendments:
Untick Use multipart/form-data box in the HTTP Request sampler
Remove issueDetail parameter name and put it to the end of "path"
Change Content-Type header value to application/json
Authorization header value might need to be correlated if the token life span is short
More information: Testing SOAP/REST Web Services Using JMeter

Response Data for "GET Method"

I am creating different HTTP Requests for a site and taking an access token as a variable from Regular Expression Extractor and using it in another HTTP Request.
The Thread group is working fine; i.e. no error in View Results Tree. But Response data is only coming for the Request with POST Method. Nothing is coming for the Request with GET Method and both requests are taking the access token properly.
In some cases you may get response code 200 ok and request still may fail. In case of your get request that seems to be happening.
Check following:
Headers being sent with get request. (Compare request being sent from JMeter and from real browser.)
Add response assertion to get request to be assure the correctness of the response. (Check what response you get for the request made from browser.)
Make sure you have added cookie manager in the test plan.

Testing both get and post http requests using Jmeter

I have an application for load testing. I am using JMeter for this purpose. I have added CSV Data Set Config to the While Controller where former reads URL from a csv file. Also, I have added a HTTP request sampler inside the controller.
Now, I have both get and post requests . In addition to that, I have to send file data with few http post requests. Is there a way so that jmeter can decide http request type automatically and create a request accordingly?
Should I create separate While Controller for both GET and POST requests?
You could add method field (post,get) and use an
IfController to eithet call a post or get depending on method value.
See:
http://jmeter.apache.org/usermanual/component_reference.html#If_Controller

how to use jmeter with ajax request

How to use JMeter with ajax request?
I have a button with is clicked and by using fiddler I can find the session id which is being sent to the server.
What should I do next using the JMeter in order to handle this.
EDIT:
Let's say I have in my hand the header which call the request. The JSESSIONID AJAXREQUEST
and so on where should I put it ?...
I putted it in http header manager name and value.
Jmeter will not execute Javascript embedded in your web page. However AJAX request is also a HTTP request that Jmeter will be able to run as a separate HTTP request and upon getting the response you can have post processors (using XPATH or REGEX) to extract the session id in a Jmeter variable.
Alternatively you can record the Jmeter scripts using Jmeter proxy and then all the HTTP requests will be recorded for you and you will just need to attach a post processor manually.

Resources