Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Recording can help a lot for e.g. to understand what exactly is being POST-ed when you have complex form submissions etc. but described below is an approach using JMeter regular expression support to arrive at stable and repeatable test scripts for Wicket applications.

...

The content of the "href" attribute can be grabbed using the following regex.

No Format
"([^"].+:create:[^"].+?)"

The interesting thing here is that this is a "generic" regex. If you know the "wicket:id", this will work for all linksany link.

Within JMeter, you can add a "Regular Expression Extractor" listener to any requested page in your test script like this. This is how the above regex will look like:

...

And the regex required is exactly the same as handling a link:

No Format
"([^"].+:form:[^"].+?)"

Using this is almost the same as a link but this time we set the request method to POST and we also provide the expected request parameters.

...

The formula for this is slightly different - single quotes instead of double quotes.

No Format
'([^'].+:new:[^'].+?)'

Conclusion

If you know the "wicket:id"s, creating repeatable JMeter tests for Wicket apps could be easier than creating them for normal web applications!

...

You can get the value you are interested in corresponding to the string "My Label" in this case like this:

No Format
<input value="([^"].+?)".*\n.*My Label

You can easily submit the value of the "myradio" parameter in the next GET or POST request by using a JMeter variable (e.g. ${myradio})

...