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

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

Introduction

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

Prototype

public static ExpectedCondition<Boolean> titleContains(final String title) 

Source Link

Document

An expectation for checking that the title contains a case-sensitive substring

Usage

From source file:org.wso2.iot.integration.ui.pages.uesr.ViewUserPage.java

License:Open Source License

public ViewUserPage(WebDriver driver) throws Exception {
    this.driver = driver;
    this.uiElementMapper = UIElementMapper.getInstance();

    WebDriverWait webDriverWait = new WebDriverWait(driver, UIUtils.webDriverTimeOut);
    if (!webDriverWait.until(ExpectedConditions.titleContains("User Management | IoT Server"))) {
        throw new IllegalStateException("This is not the User view page");
    }// w  ww .j  a v  a 2s .c  o m
}

From source file:pt.fccn.arquivo.pages.ReplayPage.java

License:Open Source License

/**
 * Jump to the current URL//from  ww  w . j  a  v  a2s.  co  m
 * wait some time to load the Webpage
 */
public void goToCurrentURL(String currentURL, String expectedTitle) throws Exception {
    driver.get(serverName + "wayback/" + currentURL);
    if (!(new WebDriverWait(driver, 180)) /* Wait Up to 180 seconds for page to load*/
            .until(ExpectedConditions.titleContains(expectedTitle))) {
        throw new Exception("Failed loading current URL: " + currentURL);
    }
}