apache / apache/jmeter

Generated HTTP sampler from cURL does not add data in corresponding tabs

Open
#5,528 0 comments 0 reactions 0 assignees View on GitHub
P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**eR@SeR** ([Bug 65274](https://bz.apache.org/bugzilla//show_bug.cgi?id=65274&redirect=false)):
Hello,

When following cURLs are pasted into "Import from cURL" in JMeter, HTTP Sampler's data is successfully generated, but inside wrong tabs:

cURL example - Content-Type: application/x-www-form-urlencoded:

curl --location --request POST 'http://example.com/access/token' \
--header 'HTTP_X_FORWARDED_FOR: 127.0.0.1' \
--header 'Accept-Language: it-IT' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'username=test'

Parameter name and value are generated inside the Value column like "username=test", instead of being properly put to Name and Value columns inside the Parameters tab.

-----------------------------

cURL example - Content-Type: application/json:

curl --location --request POST 'http://example.com/api/email' \
--header 'Accept-Language: it-IT' \
--header 'HTTP_X_FORWARDED_FOR: 127.0.0.1' \
--header 'Content-Type: application/json' \
--data-raw '{"oldEmail":"oldemail@example.com","newEmail":"newemail@example.com","applicationTypeId":1}'

JSON is generated inside the Value column like "{"oldEmail":"oldemail@example.com","newEmail":"newemail@example.com","applicationTypeId":1}", instead of being put inside the Body tab.

Check the attached images for more information.

Jmeter 5.5 5f5b816
Microsoft Windows 10 Enterprise 64-bit
java version "15.0.1" 2020-10-20

Created attachment [generated%20cURL.zip](https://apache.github.io/jmeter-bugzilla-attachments/74/65274/37840/generated%2520cURL.zip): generated cURL

Version: Nightly
Severity: normal
OS:

Contributor guide

Open the contributing guide

Research direction

Start at JMeter's "Import from cURL" entry point and reproduce the two examples from the issue. Trace how form-encoded data and JSON are assigned to the generated HTTP Sampler tabs. Done means parameters appear in the Parameters tab's Name and Value columns, while JSON appears in the Body tab.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.