Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlSubmitInput


        client.setThrowExceptionOnFailingStatusCode(false);
        // Load the page
        HtmlPage rain = client.getPage(getPath("rain.jsf"));

        // begin a conversation
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(rain, HtmlSubmitInput.class,
                "beginConversationButton");
        rain = beginConversationButton.click();
        String cid = getCid(rain);

        // Cause rain
        HtmlSubmitInput rainButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "rain");
        rain = rainButton.click();

        // Re-request the page, inside the conversation and check it has rained
        rain = client.getPage(getPath("rain.jsf", cid));
        assert hasRained(rain);
View Full Code Here


        // Load the page
        HtmlPage rain = client.getPage(getPath("rain.jsf"));

        // begin a conversation
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(rain, HtmlSubmitInput.class,
                "beginConversationButton");
        rain = beginConversationButton.click();
        String cid = getCid(rain);

        // Cause rain
        HtmlSubmitInput rainButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "rain");
        rain = rainButton.click();

        // Re-request the page, inside the conversation and check it has rained
        rain = client.getPage(getPath("rain.jsf", cid));
        assert hasRained(rain);
View Full Code Here

        WebClient client = new WebClient();
        HtmlPage page = client.getPage(getPath("cumulus.jsf"));
        assert !isLongRunning(page);

        // begin a conversation
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "beginConversationButton");
        page = beginConversationButton.click();
        assert isLongRunning(page);
    }
View Full Code Here

        WebClient client = new WebClient();
        HtmlPage page = client.getPage(getPath("cumulus.jsf"));
        assert !isLongRunning(page);

        // begin a conversation
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "beginConversationButton");
        page = beginConversationButton.click();
        assert isLongRunning(page);

        // begin a conversation again and check that IllegalStateException is thrown
        HtmlSubmitInput beginConversationButton2 = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "beginConversationAndSwallowException");
        page = beginConversationButton2.click();
        assert page.getBody().getTextContent().contains("Hello world!");
    }
View Full Code Here

        WebClient client = new WebClient();
        HtmlPage page = client.getPage(getPath("cumulus.jsf"));
        assertFalse(isLongRunning(page));

        // Begin a conversation with explicit id
        HtmlSubmitInput beginConversationButton = (HtmlSubmitInput) page
                .getElementById("form:beginNextConversationIdentifiedByCustomIdentifier");
        page = beginConversationButton.click();
        assertTrue(isLongRunning(page));

        // Try it again with the same id
        page = client.getPage(getPath("cumulus.jsf"));
        beginConversationButton = (HtmlSubmitInput) page
                .getElementById("form:beginConversationIdentifiedByCustomIdentifierAndSwallowException");
        page = beginConversationButton.click();
        // Exception is swallowed and the browser is redirected to home
        assertTrue(page.getBody().getTextContent().contains("Hello world!"));
    }
View Full Code Here

        WebClient client = new WebClient();
        HtmlPage page = client.getPage(getPath("cumulus.jsf"));
        assert !isLongRunning(page);

        // begin a conversation
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "beginConversationButton");
        page = beginConversationButton.click();
        assert isLongRunning(page);

        // end a conversation
        HtmlSubmitInput endConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "endConversationButton");
        page = endConversationButton.click();
        assert !isLongRunning(page);
    }
View Full Code Here

        WebClient client = new WebClient();
        HtmlPage page = client.getPage(getPath("cumulus.jsf"));
        assert !isLongRunning(page);

        // try ending a transient conversation
        HtmlSubmitInput endConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "endConversationAndSwallowException");
        page = endConversationButton.click();
        assert page.getBody().getTextContent().contains("Hello world!");
    }
View Full Code Here

        WebClient client = new WebClient();
        HtmlPage page = client.getPage(getPath("cumulus.jsf"));
        assertFalse(isLongRunning(page));

        // begin a conversation
        HtmlSubmitInput beginConversationButton = (HtmlSubmitInput) page
                .getElementById("form:beginConversationIdentifiedByCustomIdentifier");
        page = beginConversationButton.click();
        assertTrue(isLongRunning(page));
        assertEquals(getCid(page), "humilis");
        assertTrue(page.getBody().getTextContent().contains("Cumulus humilis"));

        HtmlPage nextPage = client.getPage(getPath("cumulus.jsf?cid=humilis"));
View Full Code Here

        WebClient client = new WebClient();
        HtmlPage page = client.getPage(getPath("cumulus.jsf"));
        assert !isLongRunning(page);

        // begin a conversation
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "beginConversationButton");
        page = beginConversationButton.click();
        assert isLongRunning(page);
        assert getCid(page) != null;
        assert page.getBody().getTextContent().contains("Cumulus congestus");
    }
View Full Code Here

        WebClient client = new WebClient();
        HtmlPage page = client.getPage(getPath("cumulus.jsf"));
        assert !isLongRunning(page);

        // begin a conversation and set a custom timeout
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "beginConversationAndSetTimeout");
        page = beginConversationButton.click();
        assert page.getBody().getTextContent().contains("Cumulonimbus");
    }
View Full Code Here

TOP

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

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.