0

How should I test this in jemeter? When I import curl from tool, data not displayed in jemeter.

curl --location --request POST 'https://bruh.uselotus.io/api/track/' \

--header 'X-API-KEY: 6tZu1NaQ.PicT21tPHTHfLrYzoLzbSk2vHhvXt7Hc' \

--header 'Content-Type: application/json' \

--data-raw '{

"batch": [

    {

        "customer_id": "d21b769b-b824-48ad-98f1-99a4ce93eac0",

        "event_name": "task_run3",

        "idempotency_id": "07f92995-8b8f-41ad-afdc-406993b31b75",

        "properties": {

            "run_count": 4000

        },

        "time_created": "2023-03-17T01:16:41.408Z"

    }

]

}'

I import this curl from the tool menu of jmeter, but I am not able to see any provided data in jmeter, how can I do that?

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Mar 17 '23 at 16:00

1 Answers1

0

Try putting everything into a single line, you're using some characters which are specific to Unix shell and JMeter doesn't recognize them

curl --location --request POST 'https://bruh.uselotus.io/api/track/' --header 'X-API-KEY: 6tZu1NaQ.PicT21tPHTHfLrYzoLzbSk2vHhvXt7Hc' --header 'Content-Type: application/json' --data-raw '{"batch":[{"customer_id":"d21b769b-b824-48ad-98f1-99a4ce93eac0","event_name":"task_run3","idempotency_id":"07f92995-8b8f-41ad-afdc-406993b31b75","properties":{"run_count":4000},"time_created":"2023-03-17T01:16:41.408Z"}]}'

Alternatively you can use JMeter's HTTP(S) Test Script Recorder for recording the request, just start JMeter's proxy and make cURL aware of this proxy via -x command-line argument.

curl -k -x http://localhost:8888 --location --request POST 'https://bruh.uselotus.io/api/track/' --header 'X-API-KEY: 6tZu1NaQ.PicT21tPHTHfLrYzoLzbSk2vHhvXt7Hc' --header 'Content-Type: application/json' --data-raw '{"batch":[{"customer_id":"d21b769b-b824-48ad-98f1-99a4ce93eac0","event_name":"task_run3","idempotency_id":"07f92995-8b8f-41ad-afdc-406993b31b75","properties":{"run_count":4000},"time_created":"2023-03-17T01:16:41.408Z"}]}'
Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks, It works a little, when when I run it, it displayed a fail, so Now I put only the data section in a body part in jmeter, and now its works perfectly. Thanks for helping :) – HS Testing World Mar 18 '23 at 04:41