Example usage for org.openqa.selenium WebElement isSelected

List of usage examples for org.openqa.selenium WebElement isSelected

Introduction

In this page you can find the example usage for org.openqa.selenium WebElement isSelected.

Prototype

boolean isSelected();

Source Link

Document

Determine whether or not this element is selected or not.

Usage

From source file:com.hotwire.selenium.desktop.us.results.car.fragments.compareWith.CompareWithFragment.java

License:Open Source License

public boolean verifyAllPartnersState(boolean state) {
    for (WebElement elm : partnerCheckboxes) {
        if (state != elm.isSelected()) {
            String status = state ? "selected" : "deselected";
            logger.warn("Checkbox of <" + elm.getAttribute("name") + "> wasn't " + status);
            return false;
        }/*from   w  ww .  ja  va2  s  .c om*/
    }
    return true;
}

From source file:com.hotwire.selenium.desktop.us.results.car.fragments.compareWith.CompareWithFragment.java

License:Open Source License

private void select(WebElement cb, boolean setChecked) {
    if (cb.isSelected()) {
        cb.click();//  w ww  .  j ava2s.co  m
    }
    if (setChecked) {
        cb.click();
    }
}

From source file:com.hotwire.selenium.desktop.us.results.hotel.fragments.filters.HotelResultsAmenitiesFilteringTabPanelFragment.java

License:Open Source License

public void checkFirstFreeAmenityCheckbox() {
    WebElement element = getFirstFreeAmenityCheckboxElement();
    if (!element.isSelected()) {
        element.click();/*from  ww w. j ava  2  s.c  om*/
        doWaitForUpdatingLayer();
    }
}

From source file:com.hotwire.selenium.desktop.us.results.hotel.fragments.filters.HotelResultsAmenitiesFilteringTabPanelFragment.java

License:Open Source License

@Override
public void checkFirstFilteringCheckbox() {
    for (WebElement element : filteringCheckboxes) {
        if (element.getAttribute("disabled") == null && !element.isSelected()) {
            element.click();//from www. ja  v a  2  s.  c o  m
            doWaitForUpdatingLayer();
            break;
        }
    }
}

From source file:com.hotwire.selenium.desktop.us.results.hotel.fragments.filters.HotelResultsAmenitiesFilteringTabPanelFragment.java

License:Open Source License

public void uncheckFirstFreeAmenityCheckbox() {
    WebElement element = getFirstFreeAmenityCheckboxElement();
    if (element.isSelected()) {
        element.click();/*from   w  w w .j  av  a 2 s .  co  m*/
        doWaitForUpdatingLayer();
    }
}

From source file:com.hotwire.selenium.desktop.us.results.hotel.fragments.filters.HotelResultsAmenitiesFilteringTabPanelFragment.java

License:Open Source License

public void checkAmenityByName(String amenityName) {
    int i = 1;/*from   ww w . j a  v  a  2 s .  co  m*/
    for (WebElement element : allNonAccessibleAmenities) {
        LOGGER.info(">>>>> " + (i++) + ": " + element.getAttribute("id"));
        if (element.getAttribute("amenityname").equals(amenityName) && !element.isSelected()) {
            JavascriptExecutor javascriptExecutor = (JavascriptExecutor) getWebDriver();
            javascriptExecutor.executeScript("$(arguments[0]).focus()", element);
            element.click();
            doWaitForUpdatingLayer();
            break;
        }
    }
}

From source file:com.hotwire.selenium.desktop.us.results.hotel.fragments.filters.HotelResultsAmenitiesFilteringTabPanelFragment.java

License:Open Source License

public void uncheckAmenityByName(String amenityName) {
    for (WebElement element : allNonAccessibleAmenities) {
        if (element.getAttribute("amenityname").equals(amenityName) && element.isSelected()) {
            element.click();/*from ww w.j ava2 s  .  com*/
            doWaitForUpdatingLayer();
            break;
        }
    }
}

From source file:com.hotwire.selenium.desktop.us.results.hotel.fragments.filters.HotelResultsAmenitiesFilteringTabPanelFragment.java

License:Open Source License

public void checkFirstAccessibilityAmenityCheckbox() {
    WebElement element = getFirstAccessibilityAmenityCheckboxElement();
    new WebDriverWait(getWebDriver(), DEFAULT_WAIT * 2)
            .until(new IsElementLocationStable(getWebDriver(), By.xpath(ACCESSIBILITY_AMENITIES_CHECKBOXES)));
    if (!element.isSelected()) {
        element.click();/*from ww  w. jav  a2  s  .com*/
        doWaitForUpdatingLayer();
    }
}

From source file:com.hotwire.selenium.desktop.us.results.hotel.fragments.filters.HotelResultsAmenitiesFilteringTabPanelFragment.java

License:Open Source License

public void uncheckFirstAccessibilityAmenityCheckbox() {
    WebElement element = getFirstAccessibilityAmenityCheckboxElement();
    if (element.isSelected()) {
        element.click();// w  w  w  . j  a  va  2 s .c  o m
        doWaitForUpdatingLayer();
    }
}

From source file:com.hotwire.selenium.desktop.us.results.hotel.fragments.filters.HotelResultsFilteringTabsPanelFragment.java

License:Open Source License

public void checkFirstFilteringCheckbox() {
    WebElement checkbox = getFirstFilteringCheckboxElement();
    if (!checkbox.isSelected()) {
        checkbox.click();//ww  w . j  ava  2 s.  c om
        doWaitForUpdatingLayer();
    }
}