Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlInput


    public void testConfiguringBlockBuildWhenUpstreamBuildingRoundtrip() throws Exception {
        FreeStyleProject p = createFreeStyleProject();       
        p.blockBuildWhenUpstreamBuilding = false;
       
        HtmlForm form = new WebClient().getPage(p, "configure").getFormByName("config");
        HtmlInput input = form.getInputByName("blockBuildWhenUpstreamBuilding");
        assertFalse("blockBuildWhenUpstreamBuilding check box is checked.", input.isChecked());
       
        input.setChecked(true);
        submit(form);       
        assertTrue("blockBuildWhenUpstreamBuilding was not updated from configuration form", p.blockBuildWhenUpstreamBuilding);
       
        form = new WebClient().getPage(p, "configure").getFormByName("config");
        input = form.getInputByName("blockBuildWhenUpstreamBuilding");
        assertTrue("blockBuildWhenUpstreamBuilding check box is not checked.", input.isChecked());
    }
View Full Code Here


    public void test1() throws Exception {
        HtmlPage p = createWebClient().goTo("self/test1");

        HtmlElement outer = (HtmlElement)p.selectSingleNode("//INPUT[@name='outer']");
        HtmlElement inner = (HtmlElement)p.selectSingleNode("//INPUT[@name='inner']");
        HtmlInput field = (HtmlInput)p.selectSingleNode("//INPUT[@type='text'][@name='_.field']");

        // outer gets unfolded, but inner should be still folded
        outer.click();
        assertFalse(field.isDisplayed());
        // now click inner, to reveal the field
        inner.click();
        assertTrue(field.isDisplayed());

        // folding outer should hide everything
        outer.click();
        assertFalse(field.isDisplayed());
        // but if we unfold outer, everything should be revealed because inner is already checked.
        outer.click();
        assertTrue(field.isDisplayed());
    }
View Full Code Here

    /**
     * Makes sure the use of "localhost" in the Hudson URL reports a warning.
     */
    public void testLocalHostWarning() throws Exception {
        HtmlPage p = new WebClient().goTo("configure");
        HtmlInput url = p.getFormByName("config").getInputByName("_.url");
        url.setValueAttribute("http://localhost:1234/");
        assertTrue(p.getDocumentElement().getTextContent().contains("instead of localhost"));
    }
View Full Code Here

      HtmlElement element = getElement(page, elementName);
      if (!(element instanceof HtmlInput))
      {
         throw new IllegalStateException("Component with name=" + elementName + " is not an HtmlInput element.");
      }
      HtmlInput inputElement = (HtmlInput)element;
      inputElement.setValueAttribute(value);
   }
View Full Code Here

        Assert.assertNotNull(autocompleteList);

        List<?> countryList = autocompleteList.getByXPath("div/div/div/div/div");
        Assert.assertEquals(30, countryList.size());

        HtmlInput input = (HtmlInput) page.getElementById("form:myAutocompleteInput");
        Assert.assertNotNull(input);
        input.type("al");

        for (int i = 0; i < 20; i++) {
            synchronized (page) {
                autocompleteList = (HtmlElement) page.getElementById("form:myAutocompleteList");
                Assert.assertNotNull(autocompleteList);
View Full Code Here

        Assert.assertNotNull(autocompleteList);

        List<?> countryList = autocompleteList.getByXPath("div/div/div/ul/li");
        Assert.assertEquals(30, countryList.size());

        HtmlInput input = (HtmlInput) page.getElementById("form:myAutocompleteInput");
        Assert.assertNotNull(input);
        input.type("be");

        for (int i = 0; i < 20; i++) {
            synchronized (page) {
                autocompleteList = (HtmlElement) page.getElementById("form:myAutocompleteList");
                Assert.assertNotNull(autocompleteList);
View Full Code Here

      logIn( );
    }
   
    HtmlPage page;
    HtmlForm form;
    HtmlInput submit;
   
    page =
    (
      client.<HtmlPage>getPage
      (
        String.format
        (
          "http://www.thehaloforum.com/newreply.php?t=%d",
          threadID
        )
      )
    );
   
    form = page.getFormByName("vbform");
   
    form.getTextAreaByName("message").setText(message);
   
    submit = form.getInputByName("sbutton");
   
    form.getSelectByName("emailupdate").getOptionByValue("9999").setSelected(true);
   
    submit.click( );
  }
View Full Code Here

    protected void click(String id, String expectedTarget)
    {
        try
        {
            HtmlInput commandNode;

            try
            {
                commandNode = this.currentForm.getInputByName(id);
            }
            catch (ElementNotFoundException e)
            {
                //in case of get-requests it isn't required that the element is in a form
                commandNode = this.currentPage.getHtmlElementById(id);
            }

            this.currentPage = commandNode.click();
            useDefaultForm();

            if(expectedTarget != null)
            {
                assertTrue(url(this.currentPage).contains(expectedTarget));
View Full Code Here

   List<HtmlRadioButtonInput> radioButtonList = form.getRadioButtonsByName("S15_");
   for(HtmlRadioButtonInput hr: radioButtonList){
     System.out.println(hr);
   }
   */
   HtmlInput hi= form.getInputByName("S19_");
   System.out.println(hi);
   Set<Cookie> cookies = wb.getCookieManager().getCookies();
   try{
  
   }
View Full Code Here

        }

        // and input tags with type="image"
        final List inputImages = htmlPage.getDocumentElement().getElementsByAttribute(HtmlConstants.INPUT, HtmlConstants.TYPE, HtmlConstants.IMAGE);
        for (final Iterator iter = inputImages.iterator(); iter.hasNext();) {
            final HtmlInput img = (HtmlInput) iter.next();
            uris.add(img.getSrcAttribute());
        }
        return uris;
    }
View Full Code Here

TOP

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

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.