I have some server side Wicket code using Apache Wicket that needs to follow a different flow for IE8, it looks roughly like this:
ClientProperties clientProperties = WebSession.get().getClientInfo().getProperties();
if (clientProperties.isBrowserInternetExplorer() && clientProperties.getBrowserVersionMajor() == 8) {
// do this
} else {
// do that
}
I want to test this code in combination with some other Wicket components, and test the combined output. I'm using the WicketTester helper class, and when I debug my code, it seems that the Wicket test framework gets reported as Firefox 9.
Now, the question is: can I easily control which browser agent is used in my test? As you can imagine, I'd rather not start mocking these classes.
You can do:
tester.getRequest().setHeader("User-Agent", "...");
tester.startPage(...);
...
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments