Example usage for org.openqa.selenium.support.ui ExpectedConditions elementToBeClickable

List of usage examples for org.openqa.selenium.support.ui ExpectedConditions elementToBeClickable

Introduction

In this page you can find the example usage for org.openqa.selenium.support.ui ExpectedConditions elementToBeClickable.

Prototype

public static ExpectedCondition<WebElement> elementToBeClickable(final WebElement element) 

Source Link

Document

An expectation for checking an element is visible and enabled such that you can click it.

Usage

From source file:org.eclipse.che.selenium.pageobject.Wizard.java

License:Open Source License

/** wait appear create button on wizard form and click */
public void clickCreateButton() {
    loader.waitOnClosed();//from  ww  w  .  j a  v a2s .  c om
    new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC)
            .until(ExpectedConditions.elementToBeClickable(saveCreateBtn));
    saveCreateBtn.click();
    loader.waitOnClosed();
}

From source file:org.eclipse.che.selenium.pageobject.Wizard.java

License:Open Source License

/** click on save button on the Project Configuration form */
public void clickSaveButton() {
    loader.waitOnClosed();//from   w  ww .ja  va  2  s.  c  o m
    new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC)
            .until(ExpectedConditions.elementToBeClickable(saveCreateBtn));
    saveCreateBtn.click();
    loader.waitOnClosed();
}

From source file:org.eclipse.che.selenium.pageobject.Wizard.java

License:Open Source License

/** click on next button on Project Configuration form */
public void clickNextButton() {
    new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC)
            .until(ExpectedConditions.elementToBeClickable(nextButton)).click();
}

From source file:org.eclipse.che.selenium.pageobject.Wizard.java

License:Open Source License

/** click the 'Browse' button on the 'Project Configuration' form */
public void clickBrowseButton(String typeFolder) {
    new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC).until(ExpectedConditions
            .elementToBeClickable(By.xpath(String.format(Locators.FOLDER_BROWSE_BUTTON_XPATH, typeFolder))))
            .click();/*www  .ja v a  2 s.com*/
}

From source file:org.eclipse.che.selenium.pageobject.Wizard.java

License:Open Source License

/** Click on '...' button in the 'Project Configuration' wizard */
public void clickOnSelectPathForParentBtn() {
    new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC)
            .until(ExpectedConditions.elementToBeClickable(By.xpath(Locators.SELECT_PATH_FOR_PARENT_BTN)))
            .click();/*from   w w w  .j a v  a 2  s .co m*/
}

From source file:org.eclipse.che.test.framework.selenium.pages.IDEMainPage.java

License:Open Source License

public WebElement getMainMenuAction(String menuPath) {
    return new WebDriverWait(driver, 30)
            .until(ExpectedConditions.elementToBeClickable(By.id("topmenu/" + menuPath)));
}

From source file:org.eclipse.packagedrone.testing.server.UserTest.java

License:Open Source License

@Test
public void testConfig() throws IOException {
    System.out.println("testConfig ()");

    driver.get(resolve("/user"));

    // check if we are on the right page

    Assert.assertEquals(resolve("/user"), driver.getCurrentUrl());

    // add// w  w  w .j  a va 2  s . co  m

    driver.get(resolve("/user/add"));

    Assert.assertEquals(resolve("/user/add"), driver.getCurrentUrl());

    // enter

    driver.findElementById("email").sendKeys(TEST_USER_EMAIL);
    driver.findElementById("name").sendKeys(TEST_USER_REAL_NAME);
    driver.findElementById("command").submit();

    // Assert.assertTrue ( driver.getCurrentUrl ().endsWith ( "/view" ) );
    wait.until(endsWith("/view"));

    final String userId = driver.findElementById("userId").getText();

    System.out.println("Button: " + driver.findElementByClassName("btn-primary").getText());
    wait.until(ExpectedConditions.elementToBeClickable(By.className("btn-primary"))).click();

    wait.until(endsWith("/" + userId + "/edit"));

    final WebElement newRoleInput = driver.findElement(By.id("newRole"));
    final WebElement newRoleButton = driver.findElement(By.id("btnNewRole"));

    newRole(newRoleInput, newRoleButton, "ADMIN");
    newRole(newRoleInput, newRoleButton, "MANAGER");

    driver.findElementById("command").submit();

    new WebDriverWait(driver, 5).until(endsWith("/" + userId + "/view"));

    System.out.println("User created");

    driver.get(resolve("/user/%s/newPassword", userId));
    driver.findElement(By.id("password")).sendKeys(TEST_USER_PASSWORD);
    driver.findElement(By.id("passwordRepeat")).sendKeys(TEST_USER_PASSWORD);
    driver.findElement(By.id("password")).submit();

    System.out.println("Password set");

    driver.get(resolve("/logout"));
    driver.get(resolve("/login"));

    driver.findElementById("email").sendKeys(TEST_USER_EMAIL);
    driver.findElementById("password").sendKeys(TEST_USER_PASSWORD);
    driver.findElementById("command").submit();

    System.out.println("User logged in");
}

From source file:org.glowroot.agent.webdriver.tests.config.AdvancedConfigPage.java

License:Apache License

public void clickSaveButton() {
    WebElement saveButton = withWait(xpath("//button[normalize-space()='Save changes']"));
    saveButton.click();// w  ww .  j  a v a  2 s. c om
    // wait for save to complete
    new WebDriverWait(driver, 30)
            .until(ExpectedConditions.not(ExpectedConditions.elementToBeClickable(saveButton)));
}

From source file:org.joinfaces.example.view.FileUploadPage.java

License:Apache License

public void upload(String file) {
    fileUploadInput.sendKeys(file);//from   w w w .  j  a  va  2  s . com

    submitButton.click();

    new WebDriverWait(webDriver, 10000).until(ExpectedConditions.elementToBeClickable(getDownloadButtonBy()));
}

From source file:org.keycloak.quickstart.ArquillianProfileJeeHtml5Test.java

License:Apache License

private void waitTillElementIsClickable(By locator) {
    Graphene.waitGui().withTimeout(30, TimeUnit.SECONDS)
            .until(ExpectedConditions.elementToBeClickable(locator));
}