Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlTextInput


     
      // Find text control
      e = client.getElement(controlId+"tempValue");
      assertNotNull("Control not found: "+controlId+"tempValue",e);
      assertTrue("Control not expected type (HtmlTextInput): "+e.getClass(),e instanceof HtmlTextInput);
      HtmlTextInput nameInput = (HtmlTextInput)e;
      // Make sure input control is hidden
      String hiddenStyle = nameInput.getStyleAttribute();
      assertTrue("Input control not hidden as expected: ["+hiddenStyle+"]",
              hiddenStyle.contains("display:none") || hiddenStyle.contains("display: none"));
     
      // Activate control - click on outside table control
      span.click();
     
      // Make sure input control is now visible
      String visibleStyle = nameInput.getStyleAttribute();
      assertFalse("Input control not visible as expected: ["+visibleStyle+"]",
              visibleStyle.contains("display:none") || visibleStyle.contains("display: none"));
     
      // Type value into input control
      nameInput.type(value);
     
      // Type #3 - CUSTOM save button
      if( customSaveId != null )
      {
         // 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");
         assertNotNull("Control not found: "+controlId+"bar",e);
         assertTrue("Control not expected type (HtmlDivision): "+e.getClass(),e instanceof HtmlDivision);
         HtmlDivision buttons = (HtmlDivision)e;
         String buttonStyle = buttons.getStyleAttribute();
         // Type #1 - NO BUTTONS
         if( buttonStyle.contains("display:none") || buttonStyle.contains("display: none") )
         {
            // Remove focus from name input control
            nameInput.blur();
           
            // Type #2 - built-in buttons
         }
         else
         {
            // Find and "mousedown" the standard "ok" button
            e = client.getElement(controlId+"ok");
            assertNotNull("Control not found: "+controlId+"ok",e);
            assertTrue("Control not expected type (HtmlImageInput): "+e.getClass(),e instanceof HtmlImageInput);
            HtmlImageInput okButton = (HtmlImageInput)e;
            okButton.fireEvent("mousedown");
         }
      }
     
      // Make sure name input is no longer visible
      hiddenStyle = nameInput.getStyleAttribute();
      assertTrue("Input control not hidden as expected: ["+hiddenStyle+"]",
              hiddenStyle.contains("display:none") || hiddenStyle.contains("display: none"));
      String inputValue = nameInput.getValueAttribute();
      assertEquals("Input control value is not set as expected",_TEST_NAME_VALUE,inputValue);
     
      // Find the hidden input control
      e = client.getElement(controlId+"value");
      assertNotNull("Control not found: "+controlId+"value",e);
View Full Code Here


            }
            final HtmlPage authPage = webClient.getPage(url);

            // submit login credentials
            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
View Full Code Here

    }
   
    @Override
    protected String getCallbackUrl(final WebClient webClient, final HtmlPage authorizationPage) throws Exception {
        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 callbackPage = submit.click();
        final String callbackUrl = callbackPage.getUrl().toString();
View Full Code Here

    }

    @Override
    protected String getCallbackUrl(final WebClient webClient, final HtmlPage authorizationPage) throws Exception {
        final HtmlForm form = authorizationPage.getForms().get(0);
        final HtmlTextInput sessionUsernameOrEmail = form.getInputByName("session[username_or_email]");
        sessionUsernameOrEmail.setValueAttribute("testscribeup@gmail.com");
        final HtmlPasswordInput sessionPassword = form.getInputByName("session[password]");
        sessionPassword.setValueAttribute("testpwdscribeup");
        final HtmlSubmitInput submit = authorizationPage.getHtmlElementById("allow");
        final HtmlPage callbackPage = submit.click();
        final String callbackUrl = callbackPage.getUrl().toString();
View Full Code Here

    }

    @Override
    protected String getCallbackUrl(final WebClient webClient, final HtmlPage authorizationPage) throws Exception {
        HtmlForm form = authorizationPage.getFormByName("loginform");
        final HtmlTextInput login = form.getInputByName("log");
        login.setValueAttribute("testscribeup");
        final HtmlPasswordInput passwd = form.getInputByName("pwd");
        passwd.setValueAttribute("testpwdscribeup");

        HtmlElement button = (HtmlElement) authorizationPage.createElement("button");
        button.setAttribute("type", "submit");
View Full Code Here

    }

    @Override
    protected String getCallbackUrl(final WebClient webClient, final HtmlPage authorizationPage) throws Exception {
        final HtmlForm form = authorizationPage.getForms().get(2);
        final HtmlTextInput login = form.getInputByName("login");
        login.setValueAttribute("testscribeup@gmail.com");
        final HtmlPasswordInput password = form.getInputByName("password");
        password.setValueAttribute("testpwdscribeup1");
        final HtmlSubmitInput submit = form.getInputByName("commit");
        final HtmlPage callbackPage = submit.click();
        final String callbackUrl = callbackPage.getUrl().toString();
View Full Code Here

    }

    @Override
    protected String getCallbackUrl(final WebClient webClient, final HtmlPage authorizationPage) throws Exception {
        HtmlForm form = authorizationPage.getFormByName("login_form");
        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();
View Full Code Here

    }
   
    @Override
    protected String getCallbackUrl(final WebClient webClient, final HtmlPage authorizationPage) throws Exception {
        final HtmlForm form = authorizationPage.getForms().get(0);
        final HtmlTextInput email = form.getInputByName("email");
        email.setValueAttribute("testscribeup@gmail.com");
        final HtmlPasswordInput password = form.getInputByName("pass");
        password.setValueAttribute("testpwdscribeup");
        final HtmlSubmitInput submit = form.getInputByName("login");
        final HtmlPage callbackPage = submit.click();
        final String callbackUrl = callbackPage.getUrl().toString();
View Full Code Here

    }

    @Override
    protected String getCallbackUrl(final WebClient webClient, final HtmlPage authorizationPage) throws Exception {
        final HtmlForm form = authorizationPage.getForms().get(0);
        final HtmlTextInput email = form.getInputByName("Email");
        email.setValueAttribute("testscribeup@gmail.com");
        final HtmlPasswordInput passwd = form.getInputByName("Passwd");
        passwd.setValueAttribute("testpwdscribeup89");
        final HtmlSubmitInput submit = form.getInputByName("signIn");

        final HtmlPage callbackPage = submit.click();
View Full Code Here

    @Override
    protected String getCallbackUrl(final WebClient webClient, final HtmlPage authorizationPage) throws Exception {
        webClient.waitForBackgroundJavaScript(5000);
        HtmlForm form = authorizationPage.getForms().get(0);
        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();
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.html.HtmlTextInput

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.