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

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

Introduction

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

Prototype

public static ExpectedCondition<Boolean> urlContains(final String fraction) 

Source Link

Document

An expectation for the URL of the current page to contain specific text.

Usage

From source file:org.opennms.smoketest.CategoriesBoxTest.java

License:Open Source License

@Test
public void testAlarmLink() throws Exception {
    // Hit the default "Network Interfaces" link on the startpage
    findElementByLink("Network Interfaces").click();
    // check for correct url...
    wait.until(ExpectedConditions.urlContains("/opennms/rtc/category.jsp"));
    // ...and header cell
    findElementByXpath("//th[text()='24hr Availability']");
}

From source file:org.orcid.integration.blackbox.api.LockedClientsTest.java

License:Open Source License

private void lookForErrorsOnAuthorizationCodePage(String clientId, String scopes, String redirectUri) {
    webDriver = new FirefoxDriver();
    webDriver.get(String.format("%s/oauth/authorize?client_id=%s&response_type=code&scope=%s&redirect_uri=%s",
            webBaseUrl, clientId, scopes, redirectUri));
    (new WebDriverWait(webDriver, 10)).until(ExpectedConditions.urlContains("error"));
    String currentUrl = webDriver.getCurrentUrl();
    if (currentUrl.contains("error=client_locked")) {
        return;//from w  ww. j a v  a2  s .c om
    }
    fail();
}

From source file:webapp.view.ViewTest.java

License:BSD License

@Test
public void viewHomePage() {

    // Load the homepage of the bookstore
    driver.get("http://localhost:8080/" + APP_CONTEXT);

    // Wait for all elements with class "categoryDropdownItem" to load
    // Once they load, store them as a list of web-element objects
    List<WebElement> categoryItems = wait
            .until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.className("categoryBox")));

    // Click on the 3rd category
    categoryItems.get(2).click();/*w  ww.j  a v  a  2s. c  o  m*/

    wait.until(ExpectedConditions.urlContains("category"));

    validatePageUrl("/" + APP_CONTEXT + "/category");
}