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.SettingsPageImpl.java

License:Open Source License

/**
 * Verify support tab displayed./*from  w ww.  j  av a 2 s  .co m*/
 * @return true, if successful
 * @see com.ecofactor.qa.automation.newapp.page.SettingsPage#verifySupportTabDisplayed()
 */
@Override
public boolean verifySupportTabDisplayed() {

    setLogString("Verify Support Tab displayed", true, CustomLogLevel.LOW);
    return isDisplayed(getDriver(), By.cssSelector(SUPPORT), TINY_TIMEOUT);
}

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

License:Open Source License

/**
 * Verify password tab displayed.//  ww w  .j a  v a 2 s  . c o  m
 * @return true, if successful
 * @see com.ecofactor.qa.automation.newapp.page.SettingsPage#verifyPasswordTabDisplayed()
 */
@Override
public boolean verifyPasswordTabDisplayed() {

    setLogString("Verify Password Tab displayed", true, CustomLogLevel.LOW);
    return isDisplayed(getDriver(), By.cssSelector(PASSWORD), TINY_TIMEOUT);
}

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

License:Open Source License

/**
 * Verify fields in password tab./*from w  w  w  . j  a v  a 2  s.  c  o m*/
 * @return true, if successful
 * @see com.ecofactor.qa.automation.newapp.page.SettingsPage#VerifyFieldsInPasswordTab()
 */
@Override
public boolean VerifyFieldsInPasswordTab() {

    setLogString("Verify fields are in password tab", true, CustomLogLevel.LOW);
    boolean fieldsDisplayed = false;
    final WebElement fields = getElement(getDriver(), By.cssSelector(ELEMENTS), TINY_TIMEOUT);
    final String className = ".prompt.old_password,.prompt.new_password,.prompt.confirm_new_password";
    String values = "";
    final StringTokenizer stringTokenizer = new StringTokenizer(className, ",");
    while (stringTokenizer.hasMoreElements()) {
        values = stringTokenizer.nextToken();
        final WebElement textFiled = getElementBySubElement(getDriver(), fields, By.cssSelector(values),
                TINY_TIMEOUT);
        setLogString("Text Fields in Password Tab" + textFiled.getText(), true, CustomLogLevel.LOW);
        fieldsDisplayed = isDisplayed(getDriver(), By.cssSelector(values), TINY_TIMEOUT);
    }
    return fieldsDisplayed && isDisplayed(getDriver(), By.cssSelector(BUTTON), TINY_TIMEOUT);
}

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

License:Open Source License

/**
 * Click password tab.//from   www. j a  v a 2s . c  o m
 * @see com.ecofactor.qa.automation.newapp.page.SettingsPage#clickPasswordTab()
 */
@Override
public void clickPasswordTab() {

    setLogString("Click password tab", true, CustomLogLevel.LOW);
    final WebElement passwordTab = getElement(getDriver(), By.cssSelector(CHANGE_PASSWORD), TINY_TIMEOUT);
    WaitUtil.oneSec();
    passwordTab.click();
    getAction().rejectAlert();
}

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

License:Open Source License

/**
 * Click faq tab.//from   w w  w  .j  a  v a2 s  . co m
 * @see com.ecofactor.qa.automation.newapp.page.SettingsPage#clickFAQTab()
 */
@Override
public void clickFAQTab() {

    setLogString("Click FAQ tab", true, CustomLogLevel.LOW);
    final WebElement faqElement = getElement(getDriver(), By.cssSelector(FAQ_TAB), TINY_TIMEOUT);
    faqElement.click();
    getAction().rejectAlert();
}

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

License:Open Source License

/**
 * Gets the thermostat name./*from   w  w w  . j  a v  a  2s  .  co m*/
 * @return the thermostat name
 * @see com.ecofactor.qa.automation.newapp.page.SettingsPage#getThermostatName()
 */
@Override
public String getThermostatName() {

    setLogString("Get Thermostat Name from Settings page", true, CustomLogLevel.LOW);
    final WebElement thermostatName = getElement(getDriver(), By.cssSelector(THERMOSTAT_NAME), TINY_TIMEOUT);
    setLogString("Thermostat Name from settings page: " + thermostatName.getText(), true, CustomLogLevel.LOW);
    return thermostatName.getText();
}

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

License:Open Source License

/**
 * Gets the password requirement error msg.
 * @return the password requirement error msg
 * @see com.ecofactor.qa.automation.newapp.page.SettingsPage#getPasswordRequirementErrorMsg()
 *//* www .jav  a2s  .  c  om*/
@Override
public void getPasswordRequirementErrorMsg() {

    setLogString("Get Password Requirement error message", true, CustomLogLevel.LOW);
    final WebElement msgElement = getElement(getDriver(), By.cssSelector(PASSWORD_ERROR_MESSAGE), TINY_TIMEOUT);
    Assert.assertTrue(PASSWORD_REQUIREMENT_MESSAGE.equalsIgnoreCase(msgElement.getText()));
    setLogString("Password Requirement error message : " + msgElement.getText(), true, CustomLogLevel.LOW);
}

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

License:Open Source License

/**
 * Click change password./*from  w  w w .  j  a va2s.c o m*/
 * @see com.ecofactor.qa.automation.newapp.page.SettingsPage#clickChangePassword()
 */
@Override
public void clickChangePasswordBtn() {

    setLogString("Click change apssword button", true, CustomLogLevel.LOW);
    final WebElement changeButton = getElement(getDriver(), By.cssSelector(BUTTON), TINY_TIMEOUT);
    changeButton.click();
}

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

License:Open Source License

/**
 * Checks if is privacy link clickable./*from w w  w.j  a va  2 s . c  om*/
 * @return true, if is privacy link clickable
 * @see com.ecofactor.qa.automation.newapp.page.SettingsPage#isPrivacyLinkClickable()
 */
@Override
public boolean isPrivacyLinkClickable() {

    setLogString("verify Privacy Link is Clickable", true, CustomLogLevel.LOW);
    final WebElement privacyLink = getElement(getDriver(), By.cssSelector(PRIVACY_LINK), TINY_TIMEOUT);
    return isClickable(getDriver(), privacyLink, TINY_TIMEOUT);
}

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

License:Open Source License

/**
 * Checks if is user agreement clickable.
 * @return true, if is user agreement clickable
 * @see com.ecofactor.qa.automation.newapp.page.SettingsPage#isUserAggrementClickable()
 *///from  ww  w . j  a  v  a  2s  .com
@Override
public boolean isUserAggrementClickable() {

    setLogString("verify User Aggrement Link is Clickable", true, CustomLogLevel.LOW);
    final WebElement userAgreementLink = getElement(getDriver(), By.cssSelector(USERAGGREMENT_LINK),
            TINY_TIMEOUT);
    return isClickable(getDriver(), userAgreementLink, TINY_TIMEOUT);
}