0
votes

I have to load test an application that uses javax.faces.FormSignature in almost every request it sends. I'm using a xPath extractor like this to get the value of the FormSignature:

/html/body/div/div/div/form/input[@name='javax.faces.FormSignature']/@value

Then I'm declaring a user defined variable and parsing the value I get using a regular expression extractor like this:

value=(.+?)

I used the HTTP Proxy Server to record my session so I'm 100% sure what GET requests to extract these values from and the POST requests that will use the values as well. It's nto working and I haven't found anything online about using FormSignature and JMeter. I'm pretty new with JMeter too on top of that. Can anybody please help me?


Ok, I had the Tidy option checked before. And the xpath works (I've checked in firebug). Here's what I have: there's a jmeter user variable called FORM, then I use the xpath mentioned above to extract a value and apply it to FORM. Then I use a regular expression extractor to extract the value only (value=\"(.+?)\"). I'm applying this regex extractor to my jmeter variable ${FORM} since this is the one (I think) that contains the result of my xpath I extracted before. The reference name of this regex extractor is FORMVALUE and this is the value I'm passing to the post request. I'm not getting a clear error, it's jsut not working. The value that is being passed to my request is the default value I set which is "FORMVALUE not found". Any ideas?

2
You can test your regex expression on response data using ViewResultsTree listener. Just select Regexp tester in the drop-down box at the bottom of the left hand panel in your ViewResultsTree listener. - Marko Bonaci
Yes, the regex seems to be working fine. I'm not sure about the xpath, though. I'm trying to get a clarification of someone that has used this same scenario with the FormSignatures before. - Izabela C.
You say it's not working. What exactly happens, which error? For testing XPath you can use huttar.net/dimitre/XPV/TopXML-XPV.html - Marko Bonaci

2 Answers

1
votes

Have you tried without the full path and with double quotes, like this:

//input[@name="javax.faces.FormSignature"]/@value
0
votes

Since you are using XPath Extractor to parse HTML (not XML) response ensure that Use Tidy (tolerant parser) option is CHECKED (in XPath Extractor's control panel).

Use xpath query from mbonaci's answer below, check the option mentioned above and try again.