Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlSubmitInput


        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);

        // Get the form that we are dealing with and within that form,
        // find the submit button and the field that we want to change.
        final HtmlForm form = (HtmlForm) page.getForms().get(0);
        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doFill");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        // check table headers
View Full Code Here


        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);

        // Get the form that we are dealing with and within that form,
        // find the submit button and the field that we want to change.
        final HtmlForm form = (HtmlForm) page.getForms().get(0);
        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doFillAll");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        //check table headers
View Full Code Here

        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);

        // Get the form that we are dealing with and within that form,
        // find the submit button and the field that we want to change.
        final HtmlForm form = (HtmlForm) page.getForms().get(0);
        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doAddDepartment");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        //check new department
View Full Code Here

        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);

        // Get the form that we are dealing with and within that form,
        // find the submit button and the field that we want to change.
        final HtmlForm form = (HtmlForm) page.getForms().get(0);
        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doChangeDepartmentNames");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        //check update departments
View Full Code Here

        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);

        // Get the form that we are dealing with and within that form,
        // find the submit button and the field that we want to change.
        final HtmlForm form = (HtmlForm) page.getForms().get(0);
        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doDeleteDepartments");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        //check that al the company 1 departments are gone..
View Full Code Here

    public void testActionMethodExceptionDoesNotDestroyContext() throws Exception {
        WebClient client = new WebClient();
        client.setThrowExceptionOnFailingStatusCode(false);

        HtmlPage page = client.getPage(getPath("/storm.jsf"));
        HtmlSubmitInput disasterButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "disasterButton");
        HtmlTextInput strength = getFirstMatchingElement(page, HtmlTextInput.class, "stormStrength");
        strength.setValueAttribute("10");
        page = disasterButton.click();
        Assert.assertEquals("Application Error", page.getTitleText());

        HtmlDivision conversationValue = getFirstMatchingElement(page, HtmlDivision.class, "conversation");
        Assert.assertEquals("10", conversationValue.asText());
View Full Code Here

    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();
    }
View Full Code Here

        ((HtmlSubmitInput) page.getElementById(GUESS_RESET)).click();
    }

    protected HtmlPage enterGuess(HtmlPage page, int guess) throws IOException {
        ((HtmlInput) page.getElementById(GUESS_FIELD)).setValueAttribute(String.valueOf(guess));
        HtmlSubmitInput submitButton = (HtmlSubmitInput) page.getElementById(GUESS_SUBMIT);
        if (submitButton.isDisabled()) {
            throw new RuntimeException("Guess button disabled on page: " + page.asText());
        }
        return submitButton.click();
    }
View Full Code Here

    public void testInvalidateSessionCalled() throws Exception {
        WebClient client = new WebClient();
        client.setThrowExceptionOnFailingStatusCode(true);

        HtmlPage page = client.getPage(getPath("/storm.jsf"));
        HtmlSubmitInput invalidateSessionButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "invalidateSessionButton");
        page = invalidateSessionButton.click();
        HtmlInput inputField = getFirstMatchingElement(page, HtmlInput.class, "prop");
        Assert.assertEquals(Storm.PROPERTY_VALUE, inputField.getValueAttribute());

        // Make another request to verify that the session bean value is not the
        // one from the previous invalidated session.
View Full Code Here

    */
    @Test
    public void testNoDoubleDestructionOnExternalRedirect() throws Exception {
        WebClient client = new WebClient();
        HtmlPage page = client.getPage(getPath("/storm.jsf"));
        HtmlSubmitInput button = getFirstMatchingElement(page, HtmlSubmitInput.class, "redirectButton");
        button.click();
    }
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.