Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.click()


        final HtmlTextInput username = form.getInputByName("username");
        username.setValueAttribute(USERNAME);
        final HtmlPasswordInput password = form.getInputByName("password");
        password.setValueAttribute(USERNAME);
        final HtmlSubmitInput submit = form.getInputByName("submit");
        final HtmlPage confirmPage = submit.click();
        final HtmlAnchor link = confirmPage.getAnchorByName("allow");
        final String callbackUrl = link.getHrefAttribute();
        logger.debug("callbackUrl : {}", callbackUrl);
        return callbackUrl;
    }
View Full Code Here


        final HtmlTextInput email = form.getInputByName("j_username");
        email.setValueAttribute("myself");
        final HtmlPasswordInput password = form.getInputByName("j_password");
        password.setValueAttribute("myself");
        final HtmlSubmitInput submit = form.getInputByValue("Login");
        final HtmlPage callbackPage = submit.click();
        String samlResponse = ((HtmlInput) callbackPage.getElementByName("SAMLResponse")).getValueAttribute();
        String relayState = ((HtmlInput) callbackPage.getElementByName("RelayState")).getValueAttribute();
        mockWebContext.addRequestParameter("SAMLResponse", samlResponse);
        mockWebContext.addRequestParameter("RelayState", relayState);
        mockWebContext.setRequestMethod("POST");
View Full Code Here

        writer.close();
        logger.debug("redirectPage path : {}", redirectFile.getPath());
        final HtmlPage redirectPage = webClient.getPage(redirectFile.toURI().toURL());
        final HtmlForm form = redirectPage.getForms().get(0);
        final HtmlSubmitInput submit = (HtmlSubmitInput) form.getElementsByAttribute("input", "type", "submit").get(0);
        return submit.click();
    }

    private String getDecodedAuthnRequest(String content) throws Exception {
        StringWebResponse response = new StringWebResponse(content, new URL("http://localhost:8080/"));
        WebClient webClient = new WebClient();
View Full Code Here

        final HtmlTextInput email = form.getInputByName("session_key");
        email.setValueAttribute("testscribeup@gmail.com");
        final HtmlPasswordInput password = form.getInputByName("session_password");
        password.setValueAttribute("testpwdscribeup56");
        final HtmlSubmitInput submit = form.getInputByName("authorize");
        final HtmlPage callbackPage = submit.click();
        final String callbackUrl = callbackPage.getUrl().toString();
        logger.debug("callbackUrl : {}", callbackUrl);
        return callbackUrl;
    }
   
View Full Code Here

            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

        // 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

        // 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

        // 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

        // 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

        // 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

TOP
Copyright © 2018 www.massapi.com. 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.