Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlSubmitInput


        final HtmlForm form = authorizationPage.getForms().get(0);
        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 HtmlForm form = authorizationPage.getForms().get(0);
        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.write(context.getResponseContent());
        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();
    }
View Full Code Here

        final HtmlForm form = authorizationPage.getFormByName("oauth2SAuthorizeForm");
        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 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

        HtmlSpan span = null;
        HtmlTextInput username = (HtmlTextInput) element("form:username");
        HtmlPasswordInput password = (HtmlPasswordInput)
            element("form:password");
        HtmlSubmitInput submit = (HtmlSubmitInput) element("form:submit");

        username.setValueAttribute("bb");
        password.setValueAttribute("");
        submit(submit);
View Full Code Here

        assertEquals("", password.getOnMouseOverAttribute());
        assertEquals("", password.getOnMouseUpAttribute());
        assertEquals("password", password.getTypeAttribute());
        assertEquals("", password.getValueAttribute());

        HtmlSubmitInput submit = (HtmlSubmitInput) element("form:submit");
        assertNotNull(submit);
        assertEquals("", submit.getLangAttribute());
        assertEquals("form:submit", submit.getNameAttribute());
        assertEquals("", submit.getOnClickAttribute());
        assertEquals("", submit.getOnDblClickAttribute());
        assertEquals("", submit.getOnKeyDownAttribute());
        assertEquals("", submit.getOnKeyPressAttribute());
        assertEquals("", submit.getOnKeyUpAttribute());
        assertEquals("", submit.getOnMouseDownAttribute());
        assertEquals("", submit.getOnMouseMoveAttribute());
        assertEquals("", submit.getOnMouseOutAttribute());
        assertEquals("", submit.getOnMouseOverAttribute());
        assertEquals("", submit.getOnMouseUpAttribute());
        assertEquals("submit", submit.getTypeAttribute());
        assertEquals("Logon", submit.getValueAttribute());

        HtmlResetInput reset = (HtmlResetInput) element("form:reset");
        assertNotNull(reset);
        assertEquals("", reset.getLangAttribute());
        assertEquals("form:reset", reset.getNameAttribute());
        assertEquals("", reset.getOnClickAttribute());
        assertEquals("", reset.getOnDblClickAttribute());
        assertEquals("", reset.getOnKeyDownAttribute());
        assertEquals("", reset.getOnKeyPressAttribute());
        assertEquals("", reset.getOnKeyUpAttribute());
        assertEquals("", reset.getOnMouseDownAttribute());
        assertEquals("", reset.getOnMouseMoveAttribute());
        assertEquals("", reset.getOnMouseOutAttribute());
        assertEquals("", reset.getOnMouseOverAttribute());
        assertEquals("", reset.getOnMouseUpAttribute());
        assertEquals("reset", reset.getTypeAttribute());
        assertEquals("Reset", reset.getValueAttribute());

        HtmlSubmitInput cancel = (HtmlSubmitInput) element("form:cancel");
        assertNotNull(cancel);
        assertEquals("", cancel.getLangAttribute());
        assertEquals("form:cancel", cancel.getNameAttribute());
        assertEquals("", cancel.getOnClickAttribute());
        assertEquals("", cancel.getOnDblClickAttribute());
        assertEquals("", cancel.getOnKeyDownAttribute());
        assertEquals("", cancel.getOnKeyPressAttribute());
        assertEquals("", cancel.getOnKeyUpAttribute());
        assertEquals("", cancel.getOnMouseDownAttribute());
        assertEquals("", cancel.getOnMouseMoveAttribute());
        assertEquals("", cancel.getOnMouseOutAttribute());
        assertEquals("", cancel.getOnMouseOverAttribute());
        assertEquals("", cancel.getOnMouseUpAttribute());
        assertEquals("submit", cancel.getTypeAttribute());
        assertEquals("Cancel", cancel.getValueAttribute());

        HtmlAnchor anchor = (HtmlAnchor) element("form:submit2");
        assertNotNull(anchor);
        assertEquals("", anchor.getAccessKeyAttribute());
        assertEquals("", anchor.getCharsetAttribute());
View Full Code Here

        HtmlSpan span = null;
        HtmlTextInput username = (HtmlTextInput) element("form:username");
        HtmlPasswordInput password = (HtmlPasswordInput)
            element("form:password");
        HtmlSubmitInput submit = (HtmlSubmitInput) element("form:submit");

        username.setValueAttribute("baduser");
        password.setValueAttribute("badpass");
        submit(submit);
View Full Code Here

    public void testSuccessful() throws Exception {

        HtmlTextInput username = (HtmlTextInput) element("form:username");
        HtmlPasswordInput password = (HtmlPasswordInput)
            element("form:password");
        HtmlSubmitInput submit = (HtmlSubmitInput) element("form:submit");

        username.setValueAttribute("gooduser");
        password.setValueAttribute("goodpass");
        submit(submit);
View Full Code Here

     */
    public void testSubmit() throws Exception {

        HtmlSpan span = null;
        HtmlSpan spanCA = null;
        HtmlSubmitInput submit = (HtmlSubmitInput) element("form:submit");
        submit(submit);
        assertEquals("context1", title());

        // Validate FacesContext Values

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.