Java Code Examples for org.openqa.selenium.support.ui.Select#deselectByValue()
The following examples show how to use
org.openqa.selenium.support.ui.Select#deselectByValue() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SeleniumSelect.java From phoenix.webui.framework with Apache License 2.0 | 5 votes |
@Override public boolean deselectByValue(Element element, String value) { Select select = createSelect(element); if(select != null) { select.deselectByValue(value); return true; } return false; }
Example 2
Source File: DeselectListOption.java From opentest with MIT License | 5 votes |
@Override public void run() { super.run(); By locator = this.readLocatorArgument("locator"); String optionValue = this.readStringArgument("optionValue", null); String optionText = this.readStringArgument("optionText", null); Integer optionNumber = this.readIntArgument("optionNumber", null); this.waitForAsyncCallsToFinish(); Select dropdownElement = new Select(this.getElement(locator)); if (optionValue != null) { dropdownElement.deselectByValue(optionValue); } else if (optionText != null) { dropdownElement.deselectByVisibleText(optionText); } else if (optionNumber != null) { dropdownElement.deselectByIndex(optionNumber - 1); } else { throw new RuntimeException( "You must identify the option you want to deselect from the " + "list by providing one of the following arguments: " + "optionValue, optionText or optionIndex."); } }
Example 3
Source File: Dropdown.java From Cognizant-Intelligent-Test-Scripter with Apache License 2.0 | 5 votes |
private void deSelect(Select select, String Data, SelectBy selectBy) { switch (selectBy) { case Index: select.deselectByIndex(Integer.parseInt(Data)); break; case Text: select.deselectByVisibleText(Data); break; case Value: select.deselectByValue(Data); break; } }