/** * Wraps Selenium's method. * * @param index index to select * @see org.openqa.selenium.support.ui.Select#deselectByIndex(int) */ public void deselectByIndex(int index) { innerSelect.deselectByIndex(index); }
/** * Deselect the option at the given index. This is done by examining the "index" attribute of an * element, and not merely by counting. * * @param index The option at this index will be deselected */ public void deselectByIndex(int index) { getSelect().deselectByIndex(index); }
@Override public LazyDomElement deselectByIndex(int index) { return executeSelect("deselectByIndex(" + index + ")", select -> select.deselectByIndex(index)); }
/** * Deselect the option at the given index. This is done by examining the "index" attribute of an * element, and not merely by counting. * * @param index The option at this index will be deselected */ public void deselectByIndex(int index) { getSelect().deselectByIndex(index); }
@Override public MultiSelect deselectByIndex(int... indexes) { for (int i : indexes) this.getWrappedSelect().deselectByIndex(i); return this; }
@Override public MultiSelect deselectByIndex(int... indexes) { for (int i : indexes) this.getWrappedSelect().deselectByIndex(i); return this; }
/** * Deselect the option at the given index. This is done by examining the "index" attribute of an * element, and not merely by counting. * * @param index The option at this index will be deselected */ public void deselectByIndex(int index) { getSelect().deselectByIndex(index); }
public Boolean execute() { getSelect().deselectByIndex(index); return true; } }
@Override public MultiSelect deselectByIndex(int... indexes) { for (int i : indexes) this.getWrappedSelect().deselectByIndex(i); return this; }
@Override public LazyDomElement deselectByIndex(int index) { return executeSelect("deselectByIndex(" + index + ")", select -> select.deselectByIndex(index)); }
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); }
public WebElementFacade byIndex(int indexValue) { if (webElementFacade.driverIsDisabled()) { return webElementFacade; } webElementFacade.waitUntilElementAvailable(); Select select = new Select(webElementFacade.getElement()); select.deselectByIndex(indexValue); webElementFacade.notifyScreenChange(); return webElementFacade; } }
selectUI.selectByIndex(index); else selectUI.deselectByIndex(index); break;
@ReplayOnError public void deselectByIndex(final Integer index) { if (!isMultiple()) { throw new UnsupportedOperationException("You may only deselect options of a multi-select"); } try { findElement(); switch (selectType) { case HTML: select.deselectByIndex(index); break; case ANGULAR_MATERIAL: case LIST: try { WebElement option = options.get(index); setDeselected(option); } catch (IndexOutOfBoundsException e) { throw new NoSuchElementException("Cannot locate element with index: " + index); } break; default: throw new CustomSeleniumTestsException(selectType + "not recognized "); } } finally { finalizeAction(); } }
/** * Deselect the option at the given index. This is done by examing the "index" attribute of an element, and not * merely by counting. * * @param index * the index to deselect */ public void deselectByIndex(int index) { getDispatcher().beforeDeselect(this, index); new Select(getElement()).deselectByIndex(index); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.CLEARED, Integer.toString(index)); } getDispatcher().afterDeselect(this, index); }