Example usage for org.openqa.selenium By cssSelector

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

Introduction

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

Prototype

public static By cssSelector(String cssSelector) 

Source Link

Document

Find elements via the driver's underlying W3C Selector engine.

Usage

From source file:com.ecofactor.qa.automation.newapp.page.impl.ThermostatPageOpsImpl.java

License:Open Source License

/**
 * Click controls icon.//from  www.j a  v a 2 s . co  m
 * @see com.ecofactor.qa.automation.newapp.page.ThermostatPageOps#clickControlsIcon()
 */
@Override
public void clickControlsIcon() {

    setLogString("Click controls icon.", true, CustomLogLevel.HIGH);
    final WebElement controlsIcon = getElement(getDriver(), By.cssSelector("div.controlsIcon"), TINY_TIMEOUT);
    getAction().click(controlsIcon);
    getAction().rejectAlert();
}

From source file:com.ecofactor.qa.automation.newapp.page.impl.ThermostatPageOpsImpl.java

License:Open Source License

/**
 * Swipe loc./*from   w w w .  j ava 2s. com*/
 * @param leftOrRight the left or right
 * @see com.ecofactor.qa.automation.newapp.page.ThermostatPageOps#swipeLoc(java.lang.String)
 */
@Override
public void swipeLoc(String leftOrRight) {

    setLogString("Swipe " + leftOrRight + " for a Location ", true, CustomLogLevel.LOW);
    final WebElement page = getElement(getDriver(), By.cssSelector("div.viewPage"), TINY_TIMEOUT);
    if (leftOrRight.equalsIgnoreCase("left")) {
        getAction().doSwipeLeft(page);
    } else {
        getAction().doSwipeRight(page);
    }
    tinyWait();
}

From source file:com.ecofactor.qa.automation.newapp.page.impl.ThermostatPageOpsImpl.java

License:Open Source License

/**
 * click set Away icon./*from   w  w w  . j  a v  a 2  s .  c  om*/
 * @see com.ecofactor.qa.automation.newapp.page.ThermostatPageOps#clickSetAway()
 */
@Override
public void clickSetAway() {

    setLogString("Click Set Away", true, CustomLogLevel.LOW);
    final WebElement awayElement = getElementBySubElement(getDriver(), getCurrentThermostatContainer(),
            By.cssSelector(SET_AWAY), TINY_TIMEOUT);
    getAction().click(awayElement);
    getAction().rejectAlert();
}

From source file:com.ecofactor.qa.automation.newapp.page.impl.ThermostatPageOpsImpl.java

License:Open Source License

/**
 * Click heat control icon.// w ww.j  a v  a2  s  .com
 * @see com.ecofactor.qa.automation.newapp.page.ThermostatPageOps#clickHeatIcon()
 */
@Override
public void clickHeatIcon() {

    setLogString("Click Heat Icon", true, CustomLogLevel.LOW);
    final WebElement heatIcon = getElementBySubElement(getDriver(), getCurrentThermostatContainer(),
            By.cssSelector(HEAT_COOL_ICON), TINY_TIMEOUT);
    getAction().click(heatIcon);
    getAction().rejectAlert();

}

From source file:com.ecofactor.qa.automation.newapp.page.impl.ThermostatPageOpsImpl.java

License:Open Source License

/**
 * click cool control icon./*from   w w w.j a v a2  s. co m*/
 * @see com.ecofactor.qa.automation.newapp.page.ThermostatPageOps#clickCoolIcon()
 */
@Override
public void clickCoolIcon() {

    setLogString("Click Cool Icon", true, CustomLogLevel.LOW);
    final WebElement heatIcon = getElementBySubElement(getDriver(), getCurrentThermostatContainer(),
            By.cssSelector(HEAT_COOL_ICON), TINY_TIMEOUT);
    getAction().click(heatIcon);
    getAction().rejectAlert();
}

From source file:com.ecofactor.qa.automation.newapp.page.impl.ThermostatPageOpsImpl.java

License:Open Source License

/**
 * click settings icon in menu page.//  ww  w .ja  va2 s.  co m
 * @see com.ecofactor.qa.automation.newapp.page.ThermostatPageOps#clickSettingsIcon()
 */
@Override
public void clickSettingsIcon() {

    setLogString("Click Settings Icon", true, CustomLogLevel.LOW);
    final WebElement settingsIcon = getElement(getDriver(), By.cssSelector(SETTINGS_ICON), TINY_TIMEOUT);
    WaitUtil.tinyWait();
    settingsIcon.click();
    // getAction().click(settingsIcon);
    getAction().rejectAlert();
    WaitUtil.oneSec();
}

From source file:com.ecofactor.qa.automation.newapp.page.impl.ThermostatPageOpsImpl.java

License:Open Source License

/**
 * All kind of settings operation can perform here.
 * @see com.ecofactor.qa.automation.newapp.page.ThermostatPageOps#settingsOperations()
 *//*from   ww  w . j a  v  a2  s.  co m*/
@Override
public void settingsOperations() {

    setLogString("Click Thermostat name Field", true, CustomLogLevel.LOW);
    final WebElement thermostatField = getElement(getDriver(), By.cssSelector(THERMOSTAT_FIELD), TINY_TIMEOUT);
    getAction().click(thermostatField);
    WaitUtil.oneSec();
    getAction().rejectAlert();

    setLogString("Thermostat Field Name Changed.", true, CustomLogLevel.LOW);
    WaitUtil.oneSec();
    final WebElement fieldValue = getElement(getDriver(), By.cssSelector(THERMOSTAT_FIELD_VALUE), TINY_TIMEOUT);
    fieldValue.clear();
    WaitUtil.oneSec();
    fieldValue.sendKeys(THERMOSTAT_FIELD_NAME);
    WaitUtil.fourSec();

    setLogString("Updated Thermostat Field Name.", true, CustomLogLevel.LOW);
    final WebElement thermostatFieldName = getElement(getDriver(), By.cssSelector(INSTALLED_THERMOSTAT),
            TINY_TIMEOUT);
    getAction().click(thermostatFieldName);
    getAction().rejectAlert();

    tinyWait();
    clickSettingsMenu();
}

From source file:com.ecofactor.qa.automation.newapp.page.impl.ThermostatPageOpsImpl.java

License:Open Source License

/**
 * Select thermostat icon in menu page.//  w w  w .jav a2s .  c o  m
 * @see com.ecofactor.qa.automation.newapp.page.ThermostatPageOps#clickThermostatIcon()
 */
@Override
public void clickThermostatIcon() {

    setLogString("Select Thermostat in Menu", true, CustomLogLevel.LOW);
    final WebElement thermostat = getElement(getDriver(), By.cssSelector(SELECT_THERMOSTAT), TINY_TIMEOUT);
    WaitUtil.oneSec();
    thermostat.click();
    // getAction().click(thermostat);
    WaitUtil.oneSec();
    getAction().rejectAlert();
}

From source file:com.ecofactor.qa.automation.newapp.page.impl.ThermostatPageOpsImpl.java

License:Open Source License

/**
 * click menu button in settings page.//from w  w w. j  a  v  a 2 s.c  om
 * @see com.ecofactor.qa.automation.newapp.page.ThermostatPageOps#clickSettingsMenu()
 */
@Override
public void clickSettingsMenu() {

    setLogString("Click Menu in Thermostat", true, CustomLogLevel.LOW);
    final WebElement menuBtn = getElement(getDriver(), By.cssSelector(MENU_BTN), TINY_TIMEOUT);
    WaitUtil.oneSec();
    getAction().click(menuBtn);
    getAction().rejectAlert();
}

From source file:com.ecofactor.qa.automation.newapp.page.impl.ThermostatPageOpsImpl.java

License:Open Source License

/**
 * click some other place in same popup.
 * @see com.ecofactor.qa.automation.newapp.page.ThermostatPageOps#clickotherplace()
 *//*from w  ww. ja v a2  s. c o  m*/
@Override
public void clickotherplace() {

    final WebElement element = getElement(getDriver(), By.cssSelector(".thermostat_button_label"),
            TINY_TIMEOUT);
    isClickable(getDriver(), element, MEDIUM_TIMEOUT);
    // setLogString("isClickable:" + yes, true);
    WaitUtil.tinyWait();

}