// ------------------------------------------------- Individual Test Methods
public void testActionAndActionListener() throws Exception {
HtmlForm form;
HtmlSubmitInput submit;
HtmlAnchor link;
HtmlTextInput input;
HtmlPage page;
page = getPage("/faces/methodref01.jsp");
form = getFormById(page, "form");
submit = (HtmlSubmitInput)
form.getInputByName("form" + NamingContainer.SEPARATOR_CHAR +
"button1");
// press button1
page = (HtmlPage) submit.click();
form = getFormById(page, "form");
input = (HtmlTextInput)
form.getInputByName("form" + NamingContainer.SEPARATOR_CHAR +
"buttonStatus");
assertTrue("Input does not have expected value",
-1 != input.asText().indexOf("button1 was pressed"));
link = (HtmlAnchor) page.getAnchors().get(0);
// press button2
page = (HtmlPage) link.click();
assertNotNull(page);
form = getFormById(page, "form");
input = (HtmlTextInput)
form.getInputByName("form" + NamingContainer.SEPARATOR_CHAR +
"buttonStatus");