Package com.gargoylesoftware.htmlunit.html

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


            webClient.getOptions().setRedirectEnabled(false);

            // validate CSRF and get authorization code
            String redirectQuery;
            try {
                final Page redirectPage = consentAccept.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


     */
    public void testGlobalConfigAjax() throws Exception {
        HtmlPage p = new WebClient().goTo("configure");
        HtmlForm f = p.getFormByName("config");
        HtmlButton b = getButtonByCaption(f, "Add Maven");
        b.click();
        findPreviousInputElement(b,"name").setValueAttribute("myMaven");
        findPreviousInputElement(b,"home").setValueAttribute("/tmp/foo");
        submit(f);
        verify();

View Full Code Here

         // Find and Click save button
         e = client.getElement(customSaveId);
         assertNotNull("Control not found: "+customSaveId,e);
         assertTrue("Control not expected type (HtmlButton): "+e.getClass(),e instanceof HtmlButton);
         HtmlButton saveButton = (HtmlButton)e;
         saveButton.click();
      }
      else
      {
         // Check to see if buttons are visible
         e = client.getElement(controlId+"bar");
View Full Code Here

        final HtmlTextInput email = form.getInputByName("login");
        email.setValueAttribute("testscribeup@yahoo.fr");
        final HtmlPasswordInput passwd = form.getInputByName("passwd");
        passwd.setValueAttribute("testpwdscribeup");
        final HtmlButton button = form.getButtonByName(".save");
        final HtmlPage confirmPage = button.click();
        String callbackUrl = confirmPage.getUrl().toString();
        try {
          form = confirmPage.getFormByName("rcForm");
          final HtmlSubmitInput submit = form.getInputByName("agree");
          final HtmlPage callbackPage = submit.click();
View Full Code Here

        final HtmlTextInput login = form.getInputByName("login_email");
        login.setValueAttribute("testscribeup@gmail.com");
        final HtmlPasswordInput passwd = form.getInputByName("login_password");
        passwd.setValueAttribute("testpwdscribeup");
        HtmlButton submit = form.getButtonByName("");
        HtmlPage confirmPage = submit.click();
        confirmPage = (HtmlPage) confirmPage.refresh();
        webClient.waitForBackgroundJavaScript(5000);
        form = confirmPage.getForms().get(0);
        HtmlButton submit2 = form.getButtonByName("allow_access");
        final HtmlPage callbackPage = submit2.click();
View Full Code Here

        HtmlPage confirmPage = submit.click();
        confirmPage = (HtmlPage) confirmPage.refresh();
        webClient.waitForBackgroundJavaScript(5000);
        form = confirmPage.getForms().get(0);
        HtmlButton submit2 = form.getButtonByName("allow_access");
        final HtmlPage callbackPage = submit2.click();
        final String callbackUrl = callbackPage.getUrl().toString();
        logger.debug("callbackUrl : {}", callbackUrl);
        return callbackUrl;
    }
View Full Code Here

        final HtmlTextInput login = form.getInputByName("login");
        login.setValueAttribute("testscribeup@yahoo.fr");
        final HtmlPasswordInput passwd = form.getInputByName("passwd");
        passwd.setValueAttribute("testpwdscribeup");
        final HtmlButton button = form.getButtonByName(".save");
        final HtmlPage confirmPage = button.click();
        form = confirmPage.getFormByName("rcForm");
        final HtmlSubmitInput submit = form.getInputByName("agree");
        final HtmlPage callbackPage = submit.click();
        final String callbackUrl = callbackPage.getUrl().toString();
        logger.debug("callbackUrl : {}", callbackUrl);
View Full Code Here

        HtmlTextInput username = form.getInputByName("username");
        username.setValueAttribute("testscribeup");
        HtmlPasswordInput password = form.getInputByName("password");
        password.setValueAttribute("testpwdscribeup78");
        HtmlButton submit = form.getButtonByName("submit");
        HtmlPage callbackPage = submit.click();
        final String callbackUrl = callbackPage.getUrl().toString();
        logger.debug("callbackUrl : {}", callbackUrl);
        return callbackUrl;
    }
View Full Code Here

            webClient.getOptions().setRedirectEnabled(false);

            // validate CSRF and get authorization code
            String redirectQuery;
            try {
                final Page redirectPage = consentAccept.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

        HtmlInput textField = form.getInputByName("name");
        textField.setValueAttribute("petra");

        HtmlButton button = (HtmlButton) form.getButtonsByName("submit").get(0);

        HtmlPage pageResponse = (HtmlPage) button.click();
       
        assertTrue(pageResponse.getWebResponse().getContentAsString().endsWith("</strong>Hello petra</body></html>"));
    }

}
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.