Hi, "panelid" instead of ":panelid"? You can dump the Component-Tree to the console with tester.dumpXXX
Am 09.02.12 21:59 schrieb "Bjørn Grønbæk" unter <bjorn.gronb...@endomondo.com>: > Hi, > > I'm just starting out with Wicket and WicketTester... > > I have a page that adds one of several panels, depending of its > PageParameter. I would like to verify that behaviour with WicketTester... > but how to? > > The code is something like this: > > String type = null; > Panel p = null; > > if(getPageParameters() != null) > type = getPageParameters().getString("BRAND_TYPE"); > > if(type != null && type.equals("BRAND")) > p = new PanelA(id); > else > p = new PanelB(id); > add(p); > > I've tried something like this: > > wicketTester.startPage(CreatePage.class); > wicketTester.assertRenderedPage(CreatePage.class); > wicketTester.assertComponent(":panelid",PanelA.class); > > but that doesn't work. The test fails with this message: > junit.framework.AssertionFailedError: component 'CreatePage' is not > type:PanelA > > Am I using the AssertComponent in a wrong way? > How else can I perform a test like that? > Could you point me to a good resource on how I find the path to components? > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org