Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlInput


    /**
     * Select this element.
     */
    public void jsxFunction_select() {
        final HtmlInput input = getHtmlInputOrDie();
        if (input instanceof HtmlTextInput) {
            ((HtmlTextInput) getDomNodeOrDie()).select();
        }
        // currently nothing for other input types
    }
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

        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 = 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 = page.getElementById("form:myAutocompleteList");
                Assert.assertNotNull(autocompleteList);
View Full Code Here

    }

    @Test
    public void testRequest() throws Exception {
        HtmlPage page = requestPage();
        HtmlInput input = getInput(page);
        assertNotNull(input);
    }
View Full Code Here

        environment = null;
    }

    protected HtmlPage submitValueAndCheckMessage(String value, Matcher<String> matcher) throws Exception {
        HtmlPage page = requestPage();
        HtmlInput input = getInput(page);
        page = (HtmlPage) input.setValueAttribute(value);
        page = submit(page);
        checkMessage(page, "uiMessage", matcher);
        return page;
    }
View Full Code Here

        HtmlElement message = page.getElementById(messageId);
        assertThat(message.getTextContent(), matcher);
    }

    protected HtmlPage submit(HtmlPage page) throws IOException {
        HtmlInput input = getInput(page);
        input.fireEvent("blur");
        return page;
    }
View Full Code Here

    }

    protected HtmlInput getInput(HtmlPage page) {
        HtmlForm htmlForm = page.getFormByName("form");
        assertNotNull(htmlForm);
        HtmlInput input = htmlForm.getInputByName("form:text");
        return input;
    }
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.