Upgrading from Wicket Page Test 2.x and 1.x to 3.x

Note that Wicket Page Test 3.x uses Wicket 1.5.x. If you're using Wicket 1.4, please use Wicket Page Test 1.x instead.

The major changes are caused by the change from Selenium 1.0 API to the Selenium 2.0 WebDriver API. Below are some examples:

DefaultSelenium selenium = WebPageTestContext.getSelenium(); 
WicketSelenium ws = new WicketSelenium(selenium);
WicketSelenium ws = WebPageTestContext.getWicketSelenium(); 
WebDriver selenium = ws.getSelenium();
ws.openBookmarkablePage(PageContainingForm.class);ws.openBookmarkablePage(PageContainingForm.class);
assert selenium.getValue("input").equals("xyz");assert ws.getValue(By.name("input")).equals("xyz");
selenium.click("//input[@type='submit']"); 
selenium.waitForPageToLoad("3000");
ws.click(By.xpath("//input[@type='submit']"));
assert selenium.getText("result").equals("xyzxyz");assert ws.getText(By.id("result")).equals("xyzxyz");
assert selenium.getValue("wicket=//eachRow[0]//v").equals("3");assert ws.getValue(new ByWicketIdPath("//eachRow[0]//v")).equals("3");
assert selenium.getText("wicket=//total").equals("13");assert ws.getText(new ByWicketIdPath("//total")).equals("13");
selenium.type("wicket=//eachRow[1]//v", "5");WebElement v1 = ws.findWicketElement("//eachRow[1]//v"); 
v1.clear(); 
v1.sendKeys("5");
selenium.click("wicket=//eachRow[1]//ok");WebElement ok = ws.findWicketElement("//eachRow[1]//ok"); 
ok.click();

In addition, the PageFlowNavigator is no longer needed. See testing page interaction for more info.