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

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

Introduction

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

Prototype

public static ExpectedCondition<WebDriver> frameToBeAvailableAndSwitchToIt(final WebElement frameLocator) 

Source Link

Document

An expectation for checking whether the given frame is available to switch to.

Usage

From source file:org.xmlium.test.web.commons.xml.XMLTestSteps.java

License:LGPL

protected Object switchTo(SwitchTo to) {
    if (to.getAlert() != null) {
        WebDriverWait wait = new WebDriverWait(getSuite().getDriver(), 2);
        Object o = wait.until(ExpectedConditions.alertIsPresent());
        return o;
    }//from  ww w  .j av  a 2  s  .  c o  m
    if (to.getFrame() != null) {
        WebDriverWait wait = new WebDriverWait(getSuite().getDriver(), 10);
        Object o = wait.until(ExpectedConditions
                .frameToBeAvailableAndSwitchToIt(By.name(unformatValue(to.getFrame().getValue()))));
        return o;
    }

    return null;
}

From source file:xbdd.stepdefs.AccessStepdefs.java

License:Apache License

@Then("^a login dialog is displayed$")
public void a_login_dialog_is_displayed() {
    new WebDriverWait(this.webDriver, 10)
            .until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("session-timeout-iframe")));
    new WebDriverWait(this.webDriver, 10)
            .until(ExpectedConditions.visibilityOfElementLocated(By.id("j_username")));
}