Package org.openqa.selenium

Examples of org.openqa.selenium.WebElement.submit()


    public void login(String username, String password) {
        final WebElement loginForm = getLoginForm();
        loginForm.findElement(By.id("usernameField")).sendKeys(username);
        loginForm.findElement(By.id("passwordField")).sendKeys(password);
        loginForm.submit();
    }

    public void openIdLogin(String openIdUrl) {
        final WebElement openIdLogin = getOpenIdLoginForm();
        openIdLogin.findElement(By.id("openid_identifier")).sendKeys(openIdUrl);
View Full Code Here


    }

    public void openIdLogin(String openIdUrl) {
        final WebElement openIdLogin = getOpenIdLoginForm();
        openIdLogin.findElement(By.id("openid_identifier")).sendKeys(openIdUrl);
        openIdLogin.submit();
    }

    public void logout() {
        final WebElement logoutLink = findElement(By.linkText("Logout"));
        logoutLink.click();
View Full Code Here

    }

    driverWithReporting.get("http://www.google.com");
    WebElement element = driverWithReporting.findElement(By.name("q"));
    element.sendKeys("Mifos");
    element.submit();
   
        (new WebDriverWait(driverWithReporting, 10))
          .until(ExpectedConditions.presenceOfElementLocated(By.id("bfoot")));
       
        driverWithReporting.quit();
View Full Code Here

    WebElement password= wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"password\"]")));
    password.sendKeys("demo");

    WebElement submit = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("button[type=\"submit\"]")));
    submit.submit();

    WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("a.tile")));
    element.click();
    Boolean found = wait.until(ExpectedConditions.textToBePresentInElement(By.tagName("h1"), "Invoice Receipt"));
  }
View Full Code Here

    WebElement password= wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"password\"]")));
    password.sendKeys("demo");

    WebElement submit = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("button[type=\"submit\"]")));
    submit.submit();

//    String xpathExpression = "//td[contains(text(),'Assign Approver')]";
//    WebElement found = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(xpathExpression)));
//    assertNotNull(found);
  }
View Full Code Here

          // Enter something to search for
          element.sendKeys("Cheese!");

          // Now submit the form. WebDriver will find the form for us from the element
          element.submit();
         
          //*** return the next page object

          // Check the title of the page
          String pageTitle = driver.getTitle();
View Full Code Here

    driver.get(pages.formPage);
    WebElement uploadElement = driver.findElement(By.id("upload"));
    assertEquals(uploadElement.getAttribute("value"), (""));

    uploadElement.sendKeys(file.getAbsolutePath());
    uploadElement.submit();

    driver.get(pages.formPage);
    uploadElement = driver.findElement(By.id("upload"));
    assertEquals(uploadElement.getAttribute("value"), (""));
View Full Code Here

    driver.get(pages.formPage);
    uploadElement = driver.findElement(By.id("upload"));
    assertEquals(uploadElement.getAttribute("value"), (""));

    uploadElement.sendKeys(file.getAbsolutePath());
    uploadElement.submit();

    // If we get this far, then we're all good.
  }

  // @Ignore(value = { IPHONE, OPERA }, reason =
View Full Code Here

  // 3508 })
  public void handleFormWithJavascriptAction() {
    String url = appServer.whereIs("form_handling_js_submit.html");
    driver.get(url);
    WebElement element = driver.findElement(By.id("theForm"));
    element.submit();
    Alert alert = driver.switchTo().alert();
    String text = alert.getText();
    alert.dismiss();

    assertEquals("Tasty cheese", text);
View Full Code Here

    }

    public void sendMessage(String data) {
        WebElement form = getSendMessage();
        form.findElement(name("body")).sendKeys(data);
        form.submit();
    }

    public WebElement getSendMessage() {
        return webDriver.findElement(xpath("//form[@name = 'sendMessage']"));
    }
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.