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

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

Introduction

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

Prototype

public static ExpectedCondition<WebElement> presenceOfElementLocated(final By locator) 

Source Link

Document

An expectation for checking that an element is present on the DOM of a page.

Usage

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

License:Open Source License

/**
 * Set value in version field on Wizard//from   ww  w .  j a v a 2 s .c o m
 *
 * @param version value of version
 */
public void setVersionOnWizard(String version) {
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
            .until(ExpectedConditions.presenceOfElementLocated(By.xpath(Locators.VERSION_INPUT))).clear();
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
            .until(ExpectedConditions.presenceOfElementLocated(By.xpath(Locators.VERSION_INPUT)))
            .sendKeys(version);
}

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

License:Open Source License

/**
 * Set value in artifact ID field on Wizard
 *
 * @param artifactId value of artifact ID
 *///from w  w  w . j  a va  2s . c  o m
public void setArtifactIdOnWizard(String artifactId) {
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
            .until(ExpectedConditions.presenceOfElementLocated(By.xpath(Locators.ARTIFACT_ID_INPUT))).clear();
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
            .until(ExpectedConditions.presenceOfElementLocated(By.xpath(Locators.ARTIFACT_ID_INPUT)))
            .sendKeys(artifactId);
}

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

License:Open Source License

/**
 * Set value in group ID field on Wizard
 *
 * @param groupId value of group ID/*from   w  w  w  .  j  a  v  a2 s. c o m*/
 */
public void setGroupIdOnWizard(String groupId) {
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
            .until(ExpectedConditions.presenceOfElementLocated(By.xpath(Locators.GROUP_ID_INPUT))).clear();
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
            .until(ExpectedConditions.presenceOfElementLocated(By.xpath(Locators.GROUP_ID_INPUT)))
            .sendKeys(groupId);
}

From source file:org.eclipse.che.selenium.workspaces.WorkingWithJavaMySqlStackTest.java

License:Open Source License

/** check main elements of the web-java-petclinic */
private void checkWebJavaPetclinicAppl() {
    new WebDriverWait(seleniumWebDriver, LOADER_TIMEOUT_SEC)
            .until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//h2[text()='Welcome']")));
    new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC)
            .until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@class='navbar-inner']")));
    new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC)
            .until(ExpectedConditions.presenceOfElementLocated(By.xpath("//table[@class='footer']")));
}

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

License:Open Source License

public WebElement getTab(String tabName) {
    return new WebDriverWait(driver, 30)
            .until(ExpectedConditions.presenceOfElementLocated(By.id("gwt-debug-tabButton-" + tabName)));
}

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

License:Open Source License

public WebElement getMainMenuItem(String mainMenuItemName) {
    return new WebDriverWait(driver, 30).until(ExpectedConditions
            .presenceOfElementLocated(By.id("gwt-debug-MainMenu/" + mainMenuItemName + "-true")));
}

From source file:org.ehoffman.testing.sample.pages.SimplePage.java

License:Apache License

public SimplePage(final WebDriver driver) {
    this.driver = driver;
    /*//from  ww  w .j  a  va2  s . com
     * Here we wait to ensure the page is fully loaded, given ajax, there is no universal way to do this. 
     */
    new WebDriverWait(driver, 10).pollingEvery(20, TimeUnit.MILLISECONDS)
            .until(ExpectedConditions.presenceOfElementLocated(By.id(OUTPUT_ID)));
    PageFactory.initElements(driver, this);
}

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

License:Apache License

public CustomInputPage waitLoad() {
    new WebDriverWait(webDriver, 10000).until(ExpectedConditions.presenceOfElementLocated(getOutputTextBy()));

    return this;
}

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

License:Apache License

public FileUploadPage waitLoad() {
    new WebDriverWait(webDriver, 10000)
            .until(ExpectedConditions.presenceOfElementLocated(getDownloadButtonBy()));

    return this;
}

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

License:Apache License

public HelloTagPage waitLoad() {
    new WebDriverWait(webDriver, 10000)
            .until(ExpectedConditions.presenceOfElementLocated(getHelloWorldDivBy()));

    return this;
}