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:org.nuxeo.functionaltests.forms.SelectOneRadioDirectoryWidgetElement.java

License:Apache License

public String getInputValue() {
    List<WebElement> options = getInputElement().findElements(By.xpath(".//input[type='radio']"));
    for (WebElement option : options) {
        if (option.isSelected()) {
            return option.getAttribute("value");
        }/*from  w  w w. j av a2  s . c  o  m*/
    }
    return "";
}

From source file:org.openlmis.pageobjects.AdultCoveragePage.java

License:Open Source License

public boolean isHealthCenterFirstNrSelected(int rowNumber) {
    WebElement healthCenter1Nr = testWebDriver.getElementById("healthCenter1Nr_" + rowNumber);
    testWebDriver.waitForElementToAppear(healthCenter1Nr);
    return healthCenter1Nr.isSelected();
}

From source file:org.openlmis.pageobjects.AdultCoveragePage.java

License:Open Source License

public boolean isHealthCenter2To5NrSelected(int rowNumber) {
    WebElement healthCenter2To5Nr = testWebDriver.getElementById("healthCenter2To5Nr_" + rowNumber);
    testWebDriver.waitForElementToAppear(healthCenter2To5Nr);
    return healthCenter2To5Nr.isSelected();
}

From source file:org.openlmis.pageobjects.AdultCoveragePage.java

License:Open Source License

public boolean isOutreachFirstNrSelected(int rowNumber) {
    WebElement outreach1Nr = testWebDriver.getElementById("outreach1Nr_" + rowNumber);
    testWebDriver.waitForElementToAppear(outreach1Nr);
    return outreach1Nr.isSelected();
}

From source file:org.openlmis.pageobjects.AdultCoveragePage.java

License:Open Source License

public boolean isOutreach2To5NrSelected(int rowNumber) {
    WebElement outreach2To5Nr = testWebDriver.getElementById("outreach2To5Nr_" + rowNumber);
    testWebDriver.waitForElementToAppear(outreach2To5Nr);
    return outreach2To5Nr.isSelected();
}

From source file:org.openlmis.pageobjects.FacilityPage.java

License:Open Source License

public HomePage verifyProgramSupported(List<String> programsSupported) {
    testWebDriver.waitForElementToAppear(editFacilityHeader);
    testWebDriver.sleep(1500);// w w  w .  j ava 2 s. co m
    String program;
    for (int i = 0; i < programsSupported.size(); i++) {
        program = programsSupported.get(i);
        WebElement programsSupportedElement = testWebDriver.getElementByXpath(
                "//table[@class='table table-striped table-bordered']/tbody/tr[" + (i + 1) + "]/td[1]");
        WebElement programsActiveElement = testWebDriver.getElementByXpath(
                "//table[@class='table table-striped table-bordered']/tbody/tr[" + (i + 1) + "]/td[2]/input");
        assertEquals(programsSupportedElement.getText().trim(), program);
        assertTrue("Program " + (i + 1) + " should be active", programsActiveElement.isSelected());
    }
    assertTrue(removeSupportedProgram.isDisplayed());
    return PageObjectFactory.getHomePage(testWebDriver);
}

From source file:org.openlmis.pageobjects.RefrigeratorPage.java

License:Open Source License

public boolean isFunctioningCorrectlyNRSelected(int refrigeratorNumber) {
    WebElement functioningCorrectlyNR = testWebDriver
            .getElementById("functioningCorrectly" + (refrigeratorNumber - 1));
    testWebDriver.waitForElementToAppear(functioningCorrectlyNR);
    return functioningCorrectlyNR.isSelected();
}

From source file:org.openlmis.pageobjects.RegimenTemplateConfigPage.java

License:Open Source License

public void selectCheckBox(WebElement locator) {
    if (!locator.isSelected()) {
        locator.click();
    }
}

From source file:org.openlmis.pageobjects.RegimenTemplateConfigPage.java

License:Open Source License

public void unSelectCheckBox(WebElement locator) {
    if (locator.isSelected()) {
        locator.click();
    }
}

From source file:org.openlmis.pageobjects.ReportPage.java

License:Open Source License

public boolean isParameterTrueOptionSelected(String displayName) {
    WebElement element = testWebDriver.getElementById("true_" + displayName);
    testWebDriver.waitForElementToAppear(element);
    return element.isSelected();
}