Posted over 5 years ago. Visible to the public.

Apache Wicket testing links in listview

Testing links in wicket is usually done like this tester.clickLink("wicketContainerId:linkId").

However if you have non-unique identifiers for example if your links are generated by a listview component then you need another approach. Fortunately this is easy. You can increment a counter (starting at 0) as a placeholders for the generated listview items. Which means you can test the links within the listview like this:

Copy
tester.clickLink("wicketContainerId:listViewId:0:linkId"); tester.clickLink("wicketContainerId:listViewId:1:linkId"); tester.clickLink("wicketContainerId:listViewId:2:linkId"); ...

Owner of this card:

Avatar
jan0sch
Last edit:
over 5 years ago
Posted by jan0sch to jan0sch's deck
This website uses cookies to improve usability and analyze traffic.
Accept or learn more