WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("cumulus.jsf"));
assertFalse(isLongRunning(page));
// Begin a conversation with explicit id
HtmlSubmitInput beginConversationButton = (HtmlSubmitInput) page
.getElementById("form:beginNextConversationIdentifiedByCustomIdentifier");
page = beginConversationButton.click();
assertTrue(isLongRunning(page));
// Try it again with the same id
page = client.getPage(getPath("cumulus.jsf"));
beginConversationButton = (HtmlSubmitInput) page
.getElementById("form:beginConversationIdentifiedByCustomIdentifierAndSwallowException");
page = beginConversationButton.click();
// Exception is swallowed and the browser is redirected to home
assertTrue(page.getBody().getTextContent().contains("Hello world!"));
}