Thanks Vit, your approach seems to be working. That is, use something like
Cookie cookie = new Cookie("name", "value"); WicketTester wicketTester = new WicketTester(new MyApplication()); wicketTester.getServletRequest().addCookie(cookie); wicketTester.startPage(new MyPage()); wicketTester.assertRenderedPage(MyPage.class); regards, Peter Vit Rozkovec wrote: > > > Hallo, > I think it should work with one of those methods: > > public final Page startPage(final ITestPageSource testPageSource) > public final Page startPage(final Page page) > instead of wicketTester.startPage(FooPage.class); > > and also you should use wicket tester's request for adding cookies: > wicketTester.getServletRequest() > > have not tried it though. > > Vitek > > > Peter Gardfjell wrote: >> Hi all, >> >> does anyone know of some easy way of adding cookies to WicketTester prior >> to >> having it visit page? >> >> That is something along the line of >> >> WicketTester wicketTester = new WicketTester(new >> MyApplication()); >> Cookie cookie = new Cookie("name", "value"); >> /* >> ... insert code for adding cookie to request here ... >> */ >> wicketTester.startPage(FooPage.class); >> wicketTester.assertRenderedPage(FooPage.class); >> >> regards, Peter >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/How-to-add-cookies-to-WicketTester--tp20733095p20787361.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]