default ExpectedCondition<Boolean> SELECTED_STATE(By by, boolean state) { return ExpectedConditions.elementSelectionStateToBe(by, state); }
default ExpectedCondition<Boolean> SELECTED_STATE(WebElement webElement, boolean state) { return ExpectedConditions.elementSelectionStateToBe(webElement, state); }
@Override public ExpectedCondition<Boolean> isSelected() { return ExpectedConditions.elementSelectionStateToBe(element, !getNegation()); }
@Override public ExpectedCondition<Boolean> isSelected() { return ExpectedConditions.elementSelectionStateToBe(element, !getNegation()); }
public Boolean isElemSelected(WebElement element) { try { return fluentWait.until(elementSelectionStateToBe(visibleElement(element), TRUE)); } catch (Exception e) { return FALSE; } }
public Boolean isElemDeselected(WebElement element) { try { return fluentWait.until(elementSelectionStateToBe(visibleElement(element), FALSE)); } catch (Exception e) { return FALSE; } }
/** * Waits during {@code timeout} until given {@code webElement} is selected. * * <p>Note! Uses only for checkboxes and radio buttons. * * @param webElement element which should be selected * @param timeout waiting time in seconds */ public void waitElementIsSelected(WebElement webElement, int timeout) { webDriverWaitFactory.get(timeout).until(elementSelectionStateToBe(webElement, true)); }
/** * Waits during {@code timeout} until given {@code webElement} is not selected. * * <p>Note! Uses only for checkboxes and radio buttons. * * @param webElement element which should be not selected * @param timeout waiting time in seconds */ public void waitElementIsNotSelected(WebElement webElement, int timeout) { webDriverWaitFactory.get(timeout).until(elementSelectionStateToBe(webElement, false)); }