org.openqa.selenium.support.ui.Select.deselectByValue()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(195)

本文整理了Java中org.openqa.selenium.support.ui.Select.deselectByValue()方法的一些代码示例,展示了Select.deselectByValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Select.deselectByValue()方法的具体详情如下:
包路径:org.openqa.selenium.support.ui.Select
类名称:Select
方法名:deselectByValue

Select.deselectByValue介绍

[英]Deselect all options that have a value matching the argument. That is, when given "foo" this would deselect an option like: <option value="foo">Bar</option>
[中]取消选择值与参数匹配的所有选项。也就是说,当给定“foo”时,这将取消选择一个选项,如:<option value=“foo”>Bar</option>

代码示例

代码示例来源:origin: elisarver/selophane

/**
 * Wraps Selenium's method.
 *
 * @param value value to deselect
 * @see org.openqa.selenium.support.ui.Select#deselectByValue(String)
 */
public void deselectByValue(String value) {
  innerSelect.deselectByValue(value);
}

代码示例来源:origin: yandex-qatools/htmlelements

/**
 * Deselect all options that have a value matching the argument. That is, when given "foo" this
 * would deselect an option like:
 * <p/>
 * &lt;option value="foo"&gt;Bar&lt;/option&gt;
 *
 * @param value The value to match against
 */
public void deselectByValue(String value) {
  getSelect().deselectByValue(value);
}

代码示例来源:origin: ru.sbtqa.htmlelements/htmlelements-java

/**
 * Deselect all options that have a value matching the argument. That is, when given "foo" this
 * would deselect an option like:
 * 
 * &lt;option value="foo"&gt;Bar&lt;/option&gt;
 *
 * @param value The value to match against
 */
public void deselectByValue(String value) {
  getSelect().deselectByValue(value);
}

代码示例来源:origin: org.seleniumhq.selenium.fluent/fluent-selenium

public Boolean execute() {
    getSelect().deselectByValue(value);
    return true;
  }
}

代码示例来源:origin: com.github.wiselenium/wiselenium-elements

@Override
public MultiSelect deselectByValue(String... values) {
  for (String v : values)
    this.getWrappedSelect().deselectByValue(v);
  return this;
}

代码示例来源:origin: com.github.wiselenium/wiselenium-core

@Override
public MultiSelect deselectByValue(String... values) {
  for (String v : values)
    this.getWrappedSelect().deselectByValue(v);
  return this;
}

代码示例来源:origin: ru.yandex.qatools.htmlelements/htmlelements-java

/**
 * Deselect all options that have a value matching the argument. That is, when given "foo" this
 * would deselect an option like:
 * <p/>
 * &lt;option value="foo"&gt;Bar&lt;/option&gt;
 *
 * @param value The value to match against
 */
public void deselectByValue(String value) {
  getSelect().deselectByValue(value);
}

代码示例来源:origin: wiselenium/wiselenium

@Override
public MultiSelect deselectByValue(String... values) {
  for (String v : values)
    this.getWrappedSelect().deselectByValue(v);
  return this;
}

代码示例来源:origin: net.code-story/simplelenium

@Override
public LazyDomElement deselectByValue(String value) {
 return executeSelect("deselectByValue(" + value + ")", select -> select.deselectByValue(value));
}

代码示例来源:origin: dgageot/simplelenium

@Override
public LazyDomElement deselectByValue(String value) {
 return executeSelect("deselectByValue(" + value + ")", select -> select.deselectByValue(value));
}

代码示例来源:origin: viltgroup/minium

@Override
protected void doPerform() {
  getSelectElement().deselectByValue(val);
}

代码示例来源:origin: com.github.webdriverextensions/webdriverextensions

public static void deselectOptionWithValue(String value, WebElement webElement) {
  new Select(webElement).deselectByValue(value);
}

代码示例来源:origin: webdriverextensions/webdriverextensions

public static void deselectOptionWithValue(String value, WebElement webElement) {
  new Select(webElement).deselectByValue(value);
}

代码示例来源:origin: stackoverflow.com

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();

代码示例来源:origin: selenium-cucumber/selenium-cucumber-java

/** 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);
}

代码示例来源:origin: net.serenity-bdd/serenity-core

public WebElementFacade byValue(String value) {
  if (webElementFacade.driverIsDisabled()) { return webElementFacade; }
  webElementFacade.waitUntilElementAvailable();
  Select select = new Select(webElementFacade.getElement());
  select.deselectByValue(value);
  webElementFacade.notifyScreenChange();
  return webElementFacade;
}

代码示例来源:origin: MarkusBernhardt/robotframework-selenium2library-java

/**
 * Unselect the given <b>*values</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 values
 *            The list of values to select
 */
@RobotKeyword
@ArgumentNames({ "locator", "*values" })
public void unselectFromListByValue(String locator, String... values) {
  if (values.equals(null)) {
    throw new Selenium2LibraryNonFatalException("No value given.");
  }
  String items = String.format("value(s) '%s'", Python.join(", ", values));
  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 value : values) {
    select.deselectByValue(value);
  }
}

代码示例来源:origin: com.infotel.seleniumRobot/core

select.deselectByValue(value);
  break;
case ANGULAR_MATERIAL:

代码示例来源:origin: MarkusBernhardt/robotframework-selenium2library-java

select.deselectByValue(item);
select.deselectByVisibleText(item);

代码示例来源:origin: paypal/SeLion

/**
 * Deselect all options that have a value matching the argument.
 * 
 * @param value
 *            the value to deselect
 */
public void deselectByValue(String value) {
  getDispatcher().beforeDeselect(this, value);
  
  new Select(getElement()).deselectByValue(value);
  if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
    logUIActions(UIActions.CLEARED, value);
  }
  
  getDispatcher().afterDeselect(this, value);
}

相关文章