Example usage for org.openqa.selenium WebDriver findElement

List of usage examples for org.openqa.selenium WebDriver findElement

Introduction

In this page you can find the example usage for org.openqa.selenium WebDriver findElement.

Prototype

@Override
WebElement findElement(By by);

Source Link

Document

Find the first WebElement using the given method.

Usage

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

public static void setBoxNoLoginAlertThreshold(WebDriver driver1, String alertThreshold) {
    logger.info("Set Alert Threshold : " + alertThreshold);
    driver1.findElement(By.cssSelector("#alertsdiv > div:nth-child(2) > input")).clear();
    driver1.findElement(By.cssSelector("#alertsdiv > div:nth-child(2) > input")).sendKeys(alertThreshold);
}

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

public static void clickSaveBoxNoLogin(WebDriver driver1, WebDriverWait wait1) throws IOException {
    logger.info("Save Alert Threshold ");

    wait1.until(ExpectedConditions//from  ww w . ja  va2 s .  c  o m
            .visibilityOfAllElementsLocatedBy(By.xpath("//*[@id=\"alertsdiv\"]/div[2]/span[1]")));
    driver1.findElement(By.xpath("//*[@id=\"alertsdiv\"]/div[2]/span[1]")).click();
    genericApplangoWebsiteActions.waitUntilWaitForServerDissappears(wait1);
}

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

public static boolean checkAlertTrigger(WebDriver driver1) throws IOException {
    logger.info("Check alert trigger");
    return driver1.findElement(By.id(applangoObject.ACTIVE_ALERT.getValue())).getAttribute("class")
            .contains("activealert");
}

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

public static void searchPeople(WebDriver driver1, WebDriverWait wait1, String firstName, String lastName,
        String email, months fromMonth, String fromYear, months toMonth, String toYear) throws IOException {
    logger.info("Search for:" + firstName + " " + lastName + " email: " + email);
    driver1.findElement(By.id(applangoTextfields.PEOPLE_PAGE_FIRSTNAME.getValue())).sendKeys(firstName);
    driver1.findElement(By.id(applangoTextfields.PEOPLE_PAGE_LASTNAME.getValue())).sendKeys(lastName);
    driver1.findElement(By.id(applangoTextfields.PEOPLE_PAGE_EMAIL.getValue())).sendKeys(email);
    clickOnPeoplePageSearchButton(driver1, wait1);

}

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

private static void clickOnPeoplePageSearchButton(WebDriver driver1, WebDriverWait wait1) throws IOException {
    logger.info("click On People Page Search Button ");
    driver1.findElement(By.id(applangoButtons.PEOPLE_PAGE_SEARCH.getValue())).click();
    waitUntilWaitForServerDissappears(wait1);
}

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

public static void clickOnUserInPeopleTable(WebDriver driver1, WebDriverWait wait1, String rowNumber)
        throws IOException {
    logger.info("click on user app in people page");
    driver1.findElement(By.cssSelector("#alluserstabler > tbody > tr:nth-child(" + rowNumber + ")")).click();
    waitUntilWaitForServerDissappears(wait1);
    waitForGraphRollUp(wait1);/*from  ww w .  ja va2 s.  com*/

}

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

public static void clickOnAppInPeopleTable(WebDriver driver1, WebDriverWait wait1) throws IOException {
    logger.info("Click on first app in table");
    if (checkUserApplicationTableIsNotEmpty(driver1)) {
        driver1.findElement(By.cssSelector(applangoObject.PEOPLEPAGE_USER_APP_TABLE.getValue())).click();
        waitUntilWaitForServerDissappears(wait1);
        checkUserAppData(wait1);//from  w  w w.j  ava  2  s. c  o  m
    }
}

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

private static boolean checkUserApplicationTableIsNotEmpty(WebDriver driver1) throws IOException {
    if (!driver1.findElement(By.cssSelector(applangoObject.PEOPLEPAGE_USER_APP_TABLE.getValue())).getText()
            .isEmpty()) {/*from  www .ja v  a  2  s. co m*/
        return true;
    } else
        return false;
}

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

public static void clickOnUserInPeoplePageUserTabler(WebDriver driver1, WebDriverWait wait1)
        throws IOException {
    logger.info(//from   w  w w . j ava2 s .c o m
            "Clicking on: " + driver1.findElement(By.xpath("//*[@id=\"usertabler\"]/tbody/tr[1]")).getText());
    clickOnUserInPeoplePageUserTabler(driver1, wait1, "1");
}

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

public static void clickOnUserInPeoplePageUserTabler(WebDriver driver1, WebDriverWait wait1, String rowNumber)
        throws IOException {
    driver1.findElement(By.xpath("//*[@id=\"usertabler\"]/tbody/tr[1]")).click();
    waitUntilWaitForServerDissappears(wait1);
    waitForHistogramToLoad(wait1);//from   ww  w.  j  a v  a  2s.c om
}