java - Post requests are not working properly with JMeter -
i have page contains list of posts, each post has comment link, onclick of it shows text area (with javascript) , user fills textarea , presses enter post comment (with ajax), , here form data see in browser after posting comment:
feedform:feedform feedform:j_idt221:0:j_idt222:j_idt286:commenttext:hi feedform:j_idt221:1:j_idt222:j_idt286:commenttext: javax.faces.viewstate:-1278084094245361929:-1028657209799449340 javax.faces.source:feedform:j_idt221:0:j_idt222:j_idt286:commenttext javax.faces.partial.event:keypress javax.faces.partial.execute:feedform:j_idt221:0:j_idt222:j_idt286:commenttext feedform:j_idt221:0:j_idt222:j_idt286:commenttext javax.faces.partial.render:feedform:j_idt221:0:j_idt222:j_idt286:commenttext feedform:j_idt221:0:j_idt222:j_idt286:feedcomments javax.faces.behavior.event:keypress javax.faces.partial.ajax:true
what did created post http request in jmeter , added above form data parameters, , when running test plan, no errors,but comment not added.
here's jsf code posting comment:
<h:inputtextarea id="commenttext" placeholder="#{msg['writeacomment.text']}" title="#{msg['writeacomment.text']}" onkeypress="if(event.keycode == 13 && !event.shiftkey){event.preventdefault();return true;}else{return false;}" value="#{feedbean.commenttext}" maxlength="2000" onkeyup="countchar(this, '#{msg['remaining.text']}')"> <f:ajax event="keypress" listener="#{feedbean.postcomment(cc.attrs.value)}" render="commenttext feedcomments" /> </h:inputtextarea>
please advise how fix that.
the issue was passing javax.faces.viewstate
hardcoded in post request, wrong, had create user defined variable
, css/jquery extractor
view state in previous request able extract view state , use in next request (off course in same page).
references:
http://anahorny.blogspot.in/2011/03/jmeter-handling-dynamic-viewstate.html
http://jmeter.apache.org/usermanual/component_reference.html#css/jquery_extractor
Comments
Post a Comment