I am new with the tool jmeter, Can you help me script this request please? Thank you in advance for your assistance



I started the test with http request, but I do not know how to integrate my token to make the call my service?

enter image description here

i have error :

Thread Name: Thread Group 1-1
Sample Start: 2018-08-14 14:39:59 CEST
Load time: 2998
Connect Time: 0
Latency: 0
Size in bytes: 1959
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 1959
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: Non HTTP response code: java.net.UnknownHostException
Response message: Non HTTP response message: my-server

Response headers:

HTTPSampleResult fields:
DataEncoding: null

closed as unclear what you're asking by trashpanda, Yu Zhang, Niels van Reijmersdal, Bharat Mane, Nitin Rastogi Aug 27 '18 at 11:19

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Do you understand what is happening when you execute this command? – Alexey R. Aug 14 '18 at 11:34
  1. Your get Unknown Host error because the value you are using in "Server Name or IP" cannot be resolved to an IP
  2. According to the CURL command you have provided in your question you should add headers to your request, however you are trying to add those values as the parameters.

So summing up, to resolve your issues, you need to:

  1. Specify proper host name
  2. Add Header Manager to your Thread Group
  3. Put headers (name and value for each header: Content-Type, Authorization) there so that your requests will be supplied with the required headers.

Just record it with JMeter's HTTP(S) Test Script Recorder

  1. Prepare JMeter for recording. The easiest way is using JMeter Templates feature.

    • From JMeter main menu choose File -> Template -> Recording and click Create
    • Click HTTP(S) Test Script Recorder and press Start button
  2. Amend your curl command to use JMeter as the proxy like:

    curl -x localhost:8888 -S -i -k -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer eyJtb2QiOiJhY2....
  • I register my request, it works very well but when I run for the second time it ends with errors. I see that jmeter added: HTTP Authorization Manager (rct.devinfo/services $ {AUTH_LOGIN} $ {AUTH_PASSWORD} KERBEROS HTTP Header Manager: Content-Type application / json User-Agent curl / 7.57.0 Accept application / json where is the pbm? – Alhamadani Aug 16 '18 at 14:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.