You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2017/01/26 14:10:18 UTC

[Bug 60649] New: HTTP(S) Test Script Recorder: wrong postdata

https://bz.apache.org/bugzilla/show_bug.cgi?id=60649

            Bug ID: 60649
           Summary: HTTP(S) Test Script Recorder: wrong postdata
           Product: JMeter
           Version: 3.1
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTTP
          Assignee: issues@jmeter.apache.org
          Reporter: bdn02@libero.it
  Target Milestone: ---

I'm using jmeter to record an internal web application, in my application are
maked some httprequest by Javascript code that pass as postdata a simple key:

<POSTDATA>
KEY

If i call my web application without recording all works fine, if i call my
application while jmeter is record the application don't work.
The problem is that jmeter recording module modify the post data adding the "="
character to request
<POSTDATA>
KEY=

Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60649] HTTP(S) Test Script Recorder: wrong postdata

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60649

--- Comment #1 from Felix Schumacher <fe...@internetallee.de> ---
Created attachment 34680
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34680&action=edit
Try to guess if body data is of name=value form

If no content-type is given for a post body, or it is the default one,
DefaultSamplerCreater will assume it is of the form name=value. This patch
looks for an equals sign in the body and if it finds none, it will assume, that
the body is not of the name=value form.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60649] HTTP(S) Test Script Recorder: wrong postdata

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60649

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om
                 OS|                            |All
             Status|NEW                         |NEEDINFO

--- Comment #2 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
(In reply to Felix Schumacher from comment #1)
> Created attachment 34680 [details]
> Try to guess if body data is of name=value form
> 
> If no content-type is given for a post body, or it is the default one,
> DefaultSamplerCreater will assume it is of the form name=value. This patch
> looks for an equals sign in the body and if it finds none, it will assume,
> that the body is not of the name=value form.

Hi Felix.
What if content is json ?
It will contain '=' , will it work ? 
AFAIK, recorder handles correctly json no ?

@Biagio, could you provide the exact post body ?
Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60649] HTTP(S) Test Script Recorder: wrong postdata

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60649

--- Comment #3 from Felix Schumacher <fe...@internetallee.de> ---
The patch will only work for the simplest case. It might even not work for
base64 coded data.

But the problem only arises, when no or the default content-type is used. My
hope is, that clients sending JSON will use the correct content-type.

Another possible solution would be to check whether the body data starts with a
regex like "(?i)[a-z0-9_.-]{30}=.", assuming that keys are not too long and
consists of only 'simple' characters.

But that seems even less fool- or fail-proof.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60649] HTTP(S) Test Script Recorder: wrong postdata

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60649

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60649] HTTP(S) Test Script Recorder: wrong postdata

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60649

Pierre <ku...@neuf.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #4 from Pierre <ku...@neuf.fr> ---
I am getting the same behavior on my tests because the content-type is not
correctly set on the app i'm testing...

What do you think if the behavior of DefaultSamplerCreater is changed like
this:
1. Tries to parse data and splits name and value (I assume it's the current way
of working)
2. If 'name' is not null AND 'value' is null, then consider that the format is
just raw data, not name=value

From a quick look, if it really was a name=value format but with an empty
value, the data will still be sent to the server like received while recording,
with no modifications, so it'll be fine.

Let me know your thoughts!

-- 
You are receiving this mail because:
You are the assignee for the bug.