Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlSubmitInput


            HtmlForm form = ((HtmlPage)page).getFormByName(formName);
            for (FormInputValue formVal : formVals) {
                HtmlInput input = form.getInputByName(formVal.getInputName());
                formVal.handleInput(input);
            }
            HtmlSubmitInput submit = form.getInputByValue("submit");
            page = submit.click();
            return this;
        }
View Full Code Here


            final HtmlForm loginForm = authPage.getFormByName("login_form");
            final HtmlTextInput login = loginForm.getInputByName("login");
            login.setText(configuration.getUserName());
            final HtmlPasswordInput password = loginForm.getInputByName("password");
            password.setText(configuration.getUserPassword());
            final HtmlSubmitInput submitInput = loginForm.getInputByName("login_submit");

            // submit consent
            final HtmlPage consentPage = submitInput.click();
            final HtmlForm consentForm = consentPage.getFormByName("consent_form");
            final HtmlButton consentAccept = consentForm.getButtonByName("consent_accept");

            // disable redirect to avoid loading redirect URL
            webClient.getOptions().setRedirectEnabled(false);
View Full Code Here

            final HtmlForm loginForm = authPage.getFormByName("oauth2SAuthorizeForm");
            final HtmlTextInput login = loginForm.getInputByName("session_key");
            login.setText(oAuthParams.getUserName());
            final HtmlPasswordInput password = loginForm.getInputByName("session_password");
            password.setText(oAuthParams.getUserPassword());
            final HtmlSubmitInput submitInput = loginForm.getInputByName("authorize");

            // disable redirect to avoid loading redirect URL
            webClient.getOptions().setRedirectEnabled(false);

            // validate CSRF and get authorization code
            String redirectQuery;
            try {
                final Page redirectPage = submitInput.click();
                redirectQuery = redirectPage.getUrl().getQuery();
            } catch (FailingHttpStatusCodeException e) {
                // escalate non redirect errors
                if (e.getStatusCode() != HttpStatus.SC_MOVED_TEMPORARILY) {
                    throw e;
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("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

    @Test(groups = { CONTEXTS })
    @SpecAssertions({ @SpecAssertion(section = "6.7.4", id = "hb"), @SpecAssertion(section = "6.7.4", id = "o") })
    public void testConversationIdSetByContainerIsUnique() throws Exception {
        WebClient client = new WebClient();
        HtmlPage storm = client.getPage(getPath("storm.jsf"));
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class,
                "beginConversationButton");
        storm = beginConversationButton.click();

        String c1 = getCid(storm);

        storm = client.getPage(getPath("storm.jsf"));
        beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
        storm = beginConversationButton.click();

        String c2 = getCid(storm);

        assertNotEquals(c1, c2);
    }
View Full Code Here

    @Test(groups = { CONTEXTS })
    @SpecAssertion(section = "6.7.4", id = "k")
    public void testLongRunningConversationInstancesNotDestroyedAtRequestEnd() throws Exception {
        WebClient client = new WebClient();
        HtmlPage storm = client.getPage(getPath("storm.jsf"));
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class,
                "beginConversationButton");
        storm = beginConversationButton.click();

        resetCloud(client);

        client.getPage(getPath("cloud.jsf", getCid(storm)));
        assert !isCloudDestroyed(client);
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.