Bug 64523 - cURL Import : Query parameters should be added in 'Parameters' section instead of request path.
Summary: cURL Import : Query parameters should be added in 'Parameters' section instea...
Status: NEW
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 5.3
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: JMETER_5.4
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-15 04:54 UTC by dineshbiradar95
Modified: 2021-05-10 18:53 UTC (History)
0 users



Attachments
Query parameters added in request path (218.28 KB, image/png)
2020-06-15 04:54 UTC, dineshbiradar95
Details
Decode query params for GET when parsing curl command (2.20 KB, patch)
2021-05-10 18:53 UTC, Felix Schumacher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dineshbiradar95 2020-06-15 04:54:09 UTC
Created attachment 37313 [details]
Query parameters added in request path

Steps to Reproduce :
- Click on "Import from cURL" option.

- Enter below GET request into "Create Test Plan from cURL" text box

curl 'https://completion.amazon.com/api/2017/suggestions?session-id=131-1551655-4391227&customer-id=&request-id=QN2EE4PFV5S1A9W82RE5&page-type=Gateway&lop=en_US&site-variant=desktop&client-info=amazon-search-ui&mid=ATVPDKIKX0DER&alias=aps&b2b=0&fresh=0&ks=80&prefix=laptop&event=onKeyPress&limit=11&fb=1&suggestion-type=KEYWORD&suggestion-type=WIDGET&_=1592195899512' \
  -H 'Connection: keep-alive' \
  -H 'Accept: application/json, text/javascript, */*; q=0.01' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36' \
  -H 'Origin: https://www.amazon.com' \
  -H 'Sec-Fetch-Site: same-site' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Referer: https://www.amazon.com/' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  --compressed

- Click on "Create Test Plan" button.
- Observe that : 
-- Request get parsed correctly but all the query parameters are added into the request path
-- The query parameters should be added into 'Parameters' section as key-value pair, so it will be easier for the user to update their values.

Expected Result :
- Query parameters should be added in 'Parameters' section instead of request 'Path' after cURL import.

Actual Result :
- Query parameters get added in request 'Path' after cURL import.

Screenshot : query_params_added_in_path.png
Comment 1 eR@SeR 2021-04-28 14:40:40 UTC
Thumbs up for the improvement. Similar issue is opened here https://bz.apache.org/bugzilla/show_bug.cgi?id=65274
Comment 2 Felix Schumacher 2021-05-10 18:53:47 UTC
Created attachment 37852 [details]
Decode query params for GET when parsing curl command

This patch tries to parse the URL and add a form field for each query param. It seems to work when combined with the GET method.

However, I am not sure, whether the assumption to parse the query params using UTF-8 is OK and it could lead to strange resuls, when path parameters (separated by ';') are used.
Comment 3 The ASF infrastructure team 2022-09-24 20:38:19 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5334