Versions Compared

Key

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

...

The main challenge when creating a Jmeter JMeter script for a Wicket application is that the links are dynamic. Of course, this is a very good thing from a security point of view. It is possible to record a test using JMeter (pdf link) but when running a recorded test against a Wicket application you have to be careful about recording and playing back tests so that that the test begins with a freshly created session. This is required to ensure that the number that appears in the "wicket:interface" parameter in the URL starts from 1 and is in sync with your script.

Recorded tests are therefore brittle and will break if you add a new link somewhere or insert a step in the middle of the flow. It would not be possible to re-try running run sections of your test while keeping your application runnning, which is desirable when developing a script.

...

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 links.

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:

...

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!

Complex Regex Matching Example

...

Tip: Paste the browser HTML source into some text editor that supports regex searches (like Textpad) and then some trial and error will narrow down the regex that fits your requirement.

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!

Ajax (TODO)

TODO: I have not yet tried to test any Ajax functionality with this approach. However I think that if you record a JMeter test involving Ajax requests and analyze the requests, you should be able to easily derive the steps and regular expressions required. If you have any success with this, please inform me or the Wicket users mailing list or update this page. Thanks!