Example usage for org.openqa.selenium By id

List of usage examples for org.openqa.selenium By id

Introduction

In this page you can find the example usage for org.openqa.selenium By id.

Prototype

public static By id(String id) 

Source Link

Usage

From source file:applango.common.services.Applango.genericApplangoWebsiteActions.java

public static void waitForUsersTableToLoad(WebDriverWait wait) throws IOException {
    wait.until(ExpectedConditions/*from w  ww  .j  ava  2  s .c o m*/
            .visibilityOfAllElementsLocatedBy(By.id(applangoObject.USERTABLE_ID.getValue().toString())));
}

From source file:applango.common.services.Applango.genericApplangoWebsiteActions.java

public static void clickOnLoginButtonAndWaitForUserListToLoad(WebDriver driver, WebDriverWait wait,
        boolean isFirstTime) throws IOException {

    clickOnLogin(driver);//w  w w .ja v  a2 s.  c om
    wait.until(
            ExpectedConditions.visibilityOfElementLocated(By.id(applangoObject.HEADER.getValue().toString())));
    if (!isFirstTime) {
        //            waitForUserListToLoad(wait);

    }
}

From source file:applango.common.services.Applango.genericApplangoWebsiteActions.java

public static void clickOnLogin(WebDriver driver) throws IOException {
    SeleniumTestBase.logger.info("Clicking on login button (by id)");
    driver.findElement(By.id(applangoButtons.LOGIN_SUBMIT.getValue())).click();

    System.currentTimeMillis();/*from  www . ja  v a  2 s . c  o m*/
    driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS);

}

From source file:applango.common.services.Applango.genericApplangoWebsiteActions.java

private static void waitForCredentialsErrorMessage(WebDriver driver, WebDriverWait wait, String errorMessage)
        throws IOException {
    wait.until(ExpectedConditions.visibilityOfElementLocated(
            By.id(applangoObject.INCORRECT_CREDENTIALS_ERRORMESSAGE.getValue().toString())));
    Assert.assertTrue(/*from w ww. ja  v  a2  s.c om*/
            driver.findElement(By.id(applangoObject.INCORRECT_CREDENTIALS_ERRORMESSAGE.getValue().toString()))
                    .getText().equals(errorMessage));
}

From source file:applango.common.services.Applango.genericApplangoWebsiteActions.java

public static void waitUntilWaitForServerDissappears(WebDriverWait wait) throws IOException {
    logger.info("Wait until waitbox disappear");
    long start = getStartTimeInMillis();
    wait.until(ExpectedConditions.invisibilityOfElementLocated((By.id(applangoObject.WAITBOX.getValue()))));
    getFinishTimeAndCompareToStartTime(start);
}

From source file:applango.common.services.Applango.genericApplangoWebsiteActions.java

public static void waitForUserDetailsInPeoplePage(WebDriverWait wait) throws IOException {
    logger.info("wait For User Details In PeoplePage");
    wait.until(ExpectedConditions//  w ww  . ja v  a 2s.co m
            .visibilityOfAllElementsLocatedBy((By.id(applangoObject.PEOPLEPAGE_USERDETAIL.getValue()))));
}

From source file:applango.common.services.Applango.genericApplangoWebsiteActions.java

private static void waitForHistogramToLoad(WebDriverWait wait) throws IOException {
    logger.info("wait For Histogram To Load");
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(applangoObject.HISTOGRAM.getValue())))
            .isDisplayed();//www.  j  ava 2s .  c o m
}

From source file:applango.common.services.Applango.genericApplangoWebsiteActions.java

public static void filterByDate(WebDriver driver1, WebDriverWait wait, String fromYear, months fromMonth,
        String untilYear, months toMonth) throws IOException {
    logger.info("Filter dates " + fromMonth + "/" + fromYear + " - " + toMonth + "/" + untilYear);
    driver1.findElement(By.id(applangoDropdowns.FROM_YEAR.getValue().toString())).sendKeys(fromYear);
    driver1.findElement(By.id(applangoDropdowns.FROM_MONTH.getValue().toString()))
            .sendKeys(fromMonth.getValue().toString());
    driver1.findElement(By.id(applangoDropdowns.UNTIL_YEAR.getValue().toString())).sendKeys(untilYear);
    driver1.findElement(By.id(applangoDropdowns.UNTIL_MONTH.getValue().toString()))
            .sendKeys(toMonth.getValue().toString());
    clickOnDateSearchButton(driver1, wait);
}

From source file:applango.common.services.Applango.genericApplangoWebsiteActions.java

public static void clickOnDateSearchButton(WebDriver driver1, WebDriverWait wait) throws IOException {
    logger.info("Clicking on Date Search button");
    driver1.findElement(By.id(applangoButtons.DATE_SEARCH.getValue().toString())).click();
    waitForUserListToLoad(wait);//from   ww w  .  ja v  a  2 s .  c om
}

From source file:applango.common.services.Applango.genericApplangoWebsiteActions.java

public static void selectUserFromList(WebDriver driver1, WebDriverWait wait, String firstName, String lastName)
        throws IOException {
    logger.info("Select user from list: " + firstName + " " + lastName);
    wait.until(//from  w  w  w .ja  v a2 s.  co  m
            ExpectedConditions.visibilityOfElementLocated(By.id(applangoTextfields.SearchLastName.getValue())));
    enterValueInSearchLastName(driver1, lastName);
    waitForUserListToLoad(wait);
    if (checkIfUserExistInList(driver1, firstName + " " + lastName)) {
        if (getNumberOfUsersInList(driver1) == 1) {
            clickOnRecordInTable(driver1, wait);
            waitForHistogramToLoad(wait);
        } else if (getNumberOfUsersInList(driver1) > 1) {
            clickOnRecordInTable(driver1, wait, firstName + " " + lastName);

        }

    }

}