/** * Wraps Selenium's method. * * @param text text to deselect by visible text * @see org.openqa.selenium.support.ui.Select#deselectByVisibleText(String) */ public void deselectByVisibleText(String text) { innerSelect.deselectByVisibleText(text); }
/** * Deselect all options that display text matching the argument. That is, when given "Bar" this * would deselect an option like: * <p/> * <option value="foo">Bar</option> * * @param text The visible text to match against */ public void deselectByVisibleText(String text) { getSelect().deselectByVisibleText(text); } }
public Boolean execute() { getSelect().deselectByVisibleText(text); return true; } }
@Override public MultiSelect deselectByVisibleText(String... texts) { for (String t : texts) this.getWrappedSelect().deselectByVisibleText(t); return this; }
@Override public MultiSelect deselectByVisibleText(String... texts) { for (String t : texts) this.getWrappedSelect().deselectByVisibleText(t); return this; }
/** * Deselect all options that display text matching the argument. That is, when given "Bar" this * would deselect an option like: * <p/> * <option value="foo">Bar</option> * * @param text The visible text to match against */ public void deselectByVisibleText(String text) { getSelect().deselectByVisibleText(text); } }
/** * Deselect all options that display text matching the argument. That is, when given "Bar" this * would deselect an option like: * * <option value="foo">Bar</option> * * @param text The visible text to match against */ public void deselectByVisibleText(String text) { getSelect().deselectByVisibleText(text); } }
@Override public MultiSelect deselectByVisibleText(String... texts) { for (String t : texts) this.getWrappedSelect().deselectByVisibleText(t); return this; }
public static void deselectOption(String text, WebElement webElement) { new Select(webElement).deselectByVisibleText(text); }
@Override protected void doPerform() { getSelectElement().deselectByVisibleText(text); } }
@Override public LazyDomElement deselectByVisibleText(String text) { return executeSelect("deselectByVisibleText(" + text + ")", select -> select.deselectByVisibleText(text)); }
@Override public LazyDomElement deselectByVisibleText(String text) { return executeSelect("deselectByVisibleText(" + text + ")", select -> select.deselectByVisibleText(text)); }
public static void deselectOption(String text, WebElement webElement) { new Select(webElement).deselectByVisibleText(text); }
WebElement dropdown = driver.findElement(By.id("month")); Select select = new Select(dropdown); select.deselectByVisibleText("Aug"); // or select.deselectByValue("7"); // or select.deselectByIndex(8); // or select.deselectAll();
/** Method to unselect option from dropdwon list @param accessType : String : Locator type (id, name, class, xpath, css) @param accessName : String : Locator value */ public void deselectOptionFromDropdown(String accessType, String optionBy, String option, String accessName) { dropdown = wait.until(ExpectedConditions.presenceOfElementLocated(getelementbytype(accessType, accessName))); selectList = new Select(dropdown); if(optionBy.equals("selectByIndex")) selectList.deselectByIndex(Integer.parseInt(option)-1); else if (optionBy.equals("value")) selectList.deselectByValue(option); else if (optionBy.equals("text")) selectList.deselectByVisibleText(option); }
private void setDeselected(final WebElement option) { switch (selectType) { case ANGULAR_MATERIAL: if ("true".equals(option.getAttribute("aria-selected"))) { HtmlElement checkbox = ((HtmlElement)((CachedHtmlElement)option).getRealElement()).findElement(By.tagName("mat-pseudo-checkbox")); if (checkbox.isElementPresent(0)) { checkbox.click(); } else { ((CachedHtmlElement)option).getRealElement().click(); } } break; case HTML: select.deselectByVisibleText(option.getText()); break; case LIST: throw new ScenarioException("Cannot deselect for list based select"); default: throw new CustomSeleniumTestsException(selectType + "not recognized "); } } }
public WebElementFacade byVisibleText(String label) { if (webElementFacade.driverIsDisabled()) { return webElementFacade; } webElementFacade.waitUntilElementAvailable(); Select select = new Select(webElementFacade.getElement()); select.deselectByVisibleText(label); webElementFacade.notifyScreenChange(); return webElementFacade; }
switch (selectType) { case HTML: select.deselectByVisibleText(text); break; case ANGULAR_MATERIAL:
/** * Unselect the given <b>*labels</b> of the multi-select list identified by * <b>locator</b>.<br> * <br> * Select list keywords work on both lists and combo boxes. Key attributes * for select lists are id and name. See `Introduction` for details about * locators.<br> * * @param locator * The locator to locate the multi-select list. * @param labels * The list of labels to select */ @RobotKeyword @ArgumentNames({ "locator", "*labels" }) public void unselectFromListByLabel(String locator, String... labels) { if (labels.equals(null)) { throw new Selenium2LibraryNonFatalException("No value given."); } String items = String.format("label(s) '%s'", Python.join(", ", labels)); logging.info(String.format("Unselecting %s from list '%s'.", items, locator)); Select select = getSelectList(locator); if (!isMultiselectList(select)) { throw new Selenium2LibraryNonFatalException( "Keyword 'Unselect from list' works only for multiselect lists."); } for (String label : labels) { select.deselectByVisibleText(label); } }
/** * Deselect all options that display text matching the argument. * * @param label * the label to deselect */ public void deselectByLabel(String label) { getDispatcher().beforeDeselect(this, label); new Select(getElement()).deselectByVisibleText(label); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.CLEARED, label); } getDispatcher().afterDeselect(this, label); } }