Search in sources :

Example 11 with HtmlTextInput

use of com.gargoylesoftware.htmlunit.html.HtmlTextInput in project core by weld.

the class NamedProducerTest method testNamedProducerFieldLoosesValues.

/*
    * description = "WELD-404"
    */
@Test
public void testNamedProducerFieldLoosesValues() throws Exception {
    WebClient client = new WebClient();
    HtmlPage page = client.getPage(getPath("/home.jsf"));
    // Check the page rendered ok
    HtmlSubmitInput saveButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "saveButton");
    HtmlTextInput employeeFieldName = getFirstMatchingElement(page, HtmlTextInput.class, "employeeFieldName");
    HtmlTextInput employeeMethodName = getFirstMatchingElement(page, HtmlTextInput.class, "employeeMethodName");
    Assert.assertNotNull(employeeFieldName);
    Assert.assertNotNull(employeeMethodName);
    Assert.assertNotNull(saveButton);
    employeeFieldName.setValueAttribute("Pete");
    employeeMethodName.setValueAttribute("Gavin");
    saveButton.click();
}
Also used : HtmlTextInput(com.gargoylesoftware.htmlunit.html.HtmlTextInput) HtmlPage(com.gargoylesoftware.htmlunit.html.HtmlPage) HtmlSubmitInput(com.gargoylesoftware.htmlunit.html.HtmlSubmitInput) WebClient(com.gargoylesoftware.htmlunit.WebClient) Test(org.junit.Test)

Aggregations

HtmlTextInput (com.gargoylesoftware.htmlunit.html.HtmlTextInput)11 HtmlPage (com.gargoylesoftware.htmlunit.html.HtmlPage)7 HtmlSubmitInput (com.gargoylesoftware.htmlunit.html.HtmlSubmitInput)6 HtmlForm (com.gargoylesoftware.htmlunit.html.HtmlForm)5 WebClient (com.gargoylesoftware.htmlunit.WebClient)4 HtmlDivision (com.gargoylesoftware.htmlunit.html.HtmlDivision)3 Test (org.junit.Test)3 FailingHttpStatusCodeException (com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException)2 Page (com.gargoylesoftware.htmlunit.Page)2 WebClientOptions (com.gargoylesoftware.htmlunit.WebClientOptions)2 HtmlButton (com.gargoylesoftware.htmlunit.html.HtmlButton)2 HtmlPasswordInput (com.gargoylesoftware.htmlunit.html.HtmlPasswordInput)2 IOException (java.io.IOException)2 URL (java.net.URL)2 SecureRandom (java.security.SecureRandom)2 HashMap (java.util.HashMap)2 Matcher (java.util.regex.Matcher)2 BoxAPIConnection (com.box.sdk.BoxAPIConnection)1 BoxAPIException (com.box.sdk.BoxAPIException)1 NicelyResynchronizingAjaxController (com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController)1