I would like to assert some label label1 in some application. I write the following junit testcase:
wicketTester.assertLabel("label1", "Hello!");
The page, where the label is added looks like this:
FooPage.java
public class FooPage extends WebPage {
public FooPage() {
add(new Label("label1", "Hello!"));
}
}
and the corresponed html page looks like this:
FooPage.html
<body>
..
...
<div wicket:id="label1"></div>
..
<body>
The label label1 – which i would like to assert- is displayed, when someone clicks on the link
<a wicket:id="fooId" href="FooPage">Foo</a>
in the following page:
<html xmlns:wicket="http://wicket.apache.org/">
<body>
<wicket:panel>
<div class="xxx">
<a wicket:id="fooId"
href="FooPage">Foo</a>
</div>
</wicket:panel>
</body>
</html>
When I run the junit Test, I get the following error:
path: 'label1' does not exist for page: BarPage
My Question is: How to get the right path for the label label1?
Have you clicked link ‘fooId’ in your test (with wicketTester.clickLink) ?