Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlTextInput


              "myform:inputId11",
              "myform:inputId11j_id_1",
              "myform:inputId11j_id_2"
        };
        for (int i = 0; i < testIds.length; i++) {
            HtmlTextInput input = (HtmlTextInput) inputTagsById.get(testIds[i]);
            input.setValueAttribute("");
        }
        List list = getAllElementsOfGivenClass(page, null,
                HtmlSubmitInput.class);
        HtmlSubmitInput button = (HtmlSubmitInput) list.get(0);
        page = (HtmlPage) button.click();
View Full Code Here


                "input", "id", "type", "text");
        String[] testIds = {
              "myform:Short11",             
        };
        for (int i = 0; i < testIds.length; i++) {
            HtmlTextInput input = (HtmlTextInput) inputTagsById.get(testIds[i]);
            input.setValueAttribute("");
        }
         List list = getAllElementsOfGivenClass(page, null,
                HtmlSubmitInput.class);
        HtmlSubmitInput button = (HtmlSubmitInput) list.get(0);
        page = (HtmlPage) button.click();
View Full Code Here

        HtmlPage page = getFormInput02();
        checkFormInput02(page, formInput02_pristine);
        HtmlForm form = getFormById(page, formInput02_name);
        assertNotNull("form exists", form);
        for (int i = 0; i < formInput02_names.length; i++) {
            HtmlTextInput input = (HtmlTextInput)
                form.getInputByName(formInput02_name +
                                    NamingContainer.SEPARATOR_CHAR +
                                    formInput02_names[i]);
            assertNotNull("field '" + formInput02_names[i] + "' exists", input);
            input.setValueAttribute(formInput02_updated[i]);
        }
        HtmlSubmitInput submit = (HtmlSubmitInput)
            form.getInputByName(formInput02_name +
                                NamingContainer.SEPARATOR_CHAR +
                                "submit");
View Full Code Here

        assertEquals("Correct page title",
                     "form-input-02", page.getTitleText());
        HtmlForm form = getFormById(page, formInput02_name);
        assertNotNull("form exists", form);
        for (int i = 0; i < expected.length; i++) {
            HtmlTextInput input = (HtmlTextInput)
                form.getInputByName(formInput02_name +
                                    NamingContainer.SEPARATOR_CHAR +
                                    formInput02_names[i]);
            assertNotNull("field '" + formInput02_names[i] + "' exists", input);
            assertEquals("field '" + formInput02_names[i] + "' value",
                         expected[i], input.getValueAttribute());
        }

    }
View Full Code Here

    public void testMultiForm() throws Exception {
        HtmlForm form;
        HtmlSubmitInput submit;
        HtmlAnchor link;
        HtmlTextInput input;
        HtmlPage page;

        page = getPage("/faces/standard/selectmany01.jsp");
        // verify that the model tier is as expected
        assertTrue(-1 !=
View Full Code Here

  HtmlPage page = getPage("/faces/test.jsp");
  List list;
  int i;
  char c, max;

  HtmlTextInput input = null;
  list = getAllElementsOfGivenClass(page, null,
            HtmlTextInput.class);
  //
  // submit values 1 thru list.size();
  //
View Full Code Here

  List list;
  int i;
  char c, max;

  HtmlSubmitInput button = null;
  HtmlTextInput input = null;
  list = getAllElementsOfGivenClass(page, null,
            HtmlTextInput.class);
  //
  // submit values 1 thru list.size();
  //
  for (i = 0; i < list.size(); i++) {
      ((HtmlTextInput)list.get(i)).setValueAttribute("" + i);
  }

  // find and press the "reload" button
  page = pressReloadButton(page);

  list = getAllElementsOfGivenClass(page, null,
            HtmlTextInput.class);
  // verify they are correctly updated
  for (i = 0; i < list.size(); i++) {
      assertEquals("" + i,
       ((HtmlTextInput)list.get(i)).getValueAttribute());
  }

  //
  // submit values a thru (a + list.size())
  //

  max = (char) ('a' + (char) list.size());
  i = 0;

  for (c = 'a'; c < max; c++) {
      ((HtmlTextInput)list.get(i++)).setValueAttribute("" + c);
  }
 
  // find and press the "reload" button
  page = pressReloadButton(page);

  list = getAllElementsOfGivenClass(page, null,
            HtmlTextInput.class);
  i = 0;
  // verify they are correctly updated
  for (c = 'a'; c < max; c++) {
      assertEquals("" + c,
       ((HtmlTextInput)list.get(i++)).getValueAttribute());
  }

  // add some ports
      
  // press first add port button
  page = pressAddPortButton(page, 0);

  // change the port number
  input = (HtmlTextInput) getNthInputContainingGivenId(page,
                   "portNumber", 0);
  input.setValueAttribute("12");

  page = pressReloadButton(page);

  // verify that it is updated correctly.
  input = (HtmlTextInput) getNthInputContainingGivenId(page,
                   "portNumber", 0);
  assertEquals("12", input.getValueAttribute());

  // press second add port button
  page = pressAddPortButton(page, 1);

  // verify that the last port input in the page doesn't the value
  input = (HtmlTextInput) getNthFromLastInputContainingGivenId(page,
                   "portNumber", 0);
  assertTrue(-1 == input.getValueAttribute().indexOf("12"));

    }
View Full Code Here

    public void testInvalidateSession() throws Exception {
        HtmlForm form;
        HtmlSubmitInput submit;
        HtmlAnchor link;
        HtmlTextInput input;
        HtmlPage page;

        page = getPage("/faces/session-invalidator.jsp");
        form = getFormById(page, "form");
        submit = (HtmlSubmitInput)
View Full Code Here

    public void testStringConverter() throws Exception {
  HtmlPage page = getPage("/faces/index.jsp");
  List list;

  HtmlTextInput input = null;
  list = getAllElementsOfGivenClass(page, null,
            HtmlTextInput.class);
  ((HtmlTextInput)list.get(0)).setValueAttribute("newString");

  HtmlSubmitInput button = null;
View Full Code Here

     * <p>Submit incorrect input fields and verify the correct response.</p>
     */
    public void testIncorrect() throws Exception {

        HtmlSpan span = null;
        HtmlTextInput username = (HtmlTextInput) element("form:username");
        HtmlPasswordInput password = (HtmlPasswordInput)
            element("form:password");
        HtmlSubmitInput submit = (HtmlSubmitInput) element("form:submit");

        username.setValueAttribute("bb");
        password.setValueAttribute("");
        submit(submit);

        assertEquals("logon", title());

        span = (HtmlSpan) element("globalErrors");
        assertNotNull(span);
        assertEquals("[EH][EP] can not be less than 3 characters.[ES]" +
                     "[EP] is required.[ES][EF]",
                     span.asText());

        username = (HtmlTextInput) element("form:username");
        assertNotNull(username);
        assertEquals("bb", username.getValueAttribute());

        span = (HtmlSpan) element("form:usernameErrors");
        assertNotNull(span);
        // FIXME:  response string should really include "Username:"
        assertEquals("[EH][EP] can not be less than 3 characters.[ES][EF]",
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.html.HtmlTextInput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.