0
votes

Jmeter POST request is not processed properly

I want to record editing a JSPWiki side with HTTP-Proxy of Jmeter. After that I want to integrate this request in my test plan.

I added a HTTP Proxy Server and a View Results Tree to my workbench and recorded editing a Wiki page. The new content I wrote into the form was added to the Wikipage, but the View Results Tree brought this up for the edit request:

Response code: 302 Response message: Moved Temporarily

I added this request to a thread group, changed the value for _editedtext (the text of the page with the new text) in this request and started the test. The underlying View results tree brought up Response Code: 200, that everything would be fine, but the content of the side didn't change.

How can I achieve a POST request for the testplan, that actually changes the content of the side?

Thank you

2

2 Answers

2
votes

I found, with version 2.8, that when .*.html is placed as the only item in the "URL Patterns to include" list on the HTTP Proxy Server configuration page (as suggested by the tutorial), only GETs were recorded. I couldn't figure out why the POSTs I triggered on the browser were only showing up in the HTTP Proxy Server "View Results Tree" logs, but were not being recorded by the "Recording Controller". When I left the "URL Patterns to include" list empty, everything, good and bad was recorded, so I had to manually delete the .js and .CSS entries, but both GETs and POSTs were finally getting recorded. I'm not sure if this was your problem and I imagine there is a better way to solve it, if it is, but it might offer a hint as to what's wrong.

0
votes

jMeter can not record javascript. If you are editing a page with a "wysiwyg" editor, it is very likely that you are trying to record a javascript site, which will not work.

There is a chance that all Javascript does is fill a field in a form, in which case you are on the right track. You'd have to inspect the page source and try to figure out what exactly happens under the hood.

The 302 is probably behaviour of the submit action where the developer wants to make sure your browser gets redirected to another URL. Most of the time this is a trick to prevent problems when a user presses "refresh" on the web page.