Bug 52613 - Using Raw Post Body option, text is considered as encoded
Using Raw Post Body option, text is considered as encoded
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.6
All All
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
: 52896 53068 53181 53587 (view as bug list)
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-02-06 22:10 UTC by Philippe Mouawad
Modified: 2012-07-23 11:59 UTC (History)
5 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Mouawad 2012-02-06 22:10:51 UTC
I have a case where I put in Raw Post Body:
"toto+titi"

When I save text , it gets changed into "toto titi".
Comment 1 Philippe Mouawad 2012-02-07 06:25:26 UTC
Date: Tue Feb  7 06:24:05 2012
New Revision: 1241359

URL: http://svn.apache.org/viewvc?rev=1241359&view=rev
Log:
Bug 52613 - Using Raw Post Body option, text is considered as encoded

Modified:
   jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java
   jmeter/trunk/xdocs/changes.xml
Comment 2 Philippe Mouawad 2012-03-13 12:28:23 UTC
*** Bug 52896 has been marked as a duplicate of this bug. ***
Comment 3 Philippe Mouawad 2012-04-13 07:09:34 UTC
*** Bug 53068 has been marked as a duplicate of this bug. ***
Comment 4 Philippe Mouawad 2012-05-03 07:48:51 UTC
*** Bug 53181 has been marked as a duplicate of this bug. ***
Comment 5 Philippe Mouawad 2012-05-03 08:19:16 UTC
Adding some more information to ease finding this bug (3 duplicates since it was open + user mailing list messages)
Bug has the following manifestations:

- HTTP Request Sampler destroys testplan with %-sign in Post Body
Testcase: 
1) Add a HTTP Request Sampler to a Test Plan
2) switch to the Post Body view.
3) write a percent sign (and any additional content) in the data field
4) switch out of the sampler

Expected:
Nothing special should happen

Actual:
* The Element is displayed without text and a random symbol
* When clicking the element again it shows the error "Problem updating GUI - see log file for details"

1) when you then save the test plan it works, but gives you more of the same warnings and does not remember the saved state (it always shows "there are unsaved changes" when closing the testplan)
2) When you want to reopen the saved test plan it fails and tells you the test plan is invalid.

- Cannot POST a "%" character - URLDecoder executes multiple times 
Saving the Test Plan apparently passes an HTTP Request's Raw Post Body through URLDecoder 3 times. Running the Test Plan passes it through URLDecoder once.

I need to post XML content to a web service, and that content includes a "%" symbol. I can either escape it 4x to save and run (e.g. "%25252525"), or escape once and run (e.g. "%25"). After either case, saving or running the Test Plan mangles my Post Body, so I have to start over.

To illustrate the problem quickly, create an HTTP Request with "%%" alone in the post body and save. You should get "Problem updating GUI - see log for details". The first error in the log (among a few) is:

2012/04/12 12:38:59 ERROR - jmeter.gui.GuiPackage: Problem retrieving gui java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "%?"

- Unable to use "%" symbol in request and responce data:
There is an error in gui when try to use symbol "%" in request or when it exists in responce data

E.g. if request POST data has to have string like "%AO2012" JMeter report an error in GUI and post an exception into log (stack_trace.txt)

Steps to reproduce:
1. Add HTTP request
2. Switch to RAW data 
3. Input string like "2004016611|AOconnectRequest:AHconnect:ASDateTimeFormatInfo:ALCurrentDate%AO20120313150624#" (this is a part of GWT request to server)
4. Save
Comment 6 Philippe Mouawad 2012-07-23 11:59:21 UTC
*** Bug 53587 has been marked as a duplicate of this bug. ***