Selects select element option

@param $sSelector
@param $sOptionSelector
966703
public function select($sSelector, $sOptionSelector)
    {
        $oSelectorsHandler = $this->getMinkSession()->getSelectorsHandler();
        $oSelect = null;

        if (strpos($sSelector, '/') === false) {
            $page = $this->getMinkSession()->getPage();
            $sParsedSelector = $oSelectorsHandler->xpathLiteral($sSelector);
            $oSelect = $page->find('named', array('select', $sParsedSelector));
        }

        if (is_null($oSelect)) {
            $oSelect = $this->getElementLazy($sSelector);
        }

        if (strpos($sOptionSelector, 'index=') === 0) {
            $iIndex = str_replace('index=', '', $sOptionSelector);
            $sOptionSelector = $this->_getSelectOptionByIndex($oSelect, $iIndex);
        } else {
            $sOptionSelector = str_replace(array('label=', 'value='), '', $sOptionSelector);
        }

        if (is_null($oSelect)) {
            $this->fail("Select '$sSelector' was not found!");
        }

        $oOptions = $oSelect->findAll('named', array('option', $oSelectorsHandler->xpathLiteral($sOptionSelector)));

        $oOption = $this->_getExactMatch($oOptions, $sOptionSelector);

        if (is_null($oOption)) {
            $this->fail("Option '$sOptionSelector' was not found in '$sSelector' select ");
        }

        $this->getMinkSession()->getDriver()->selectOption(
            $oSelect->getXpath(), $oOption->getValue(), false
        );

        $this->fireEvent($sSelector, 'change');
    }
1251709
public static function getNumberOperands($includeSelector = false)
    {
        $values = array(
            self::OPERATOR_EQUAL,
            self::OPERATOR_GREATER_THAN,
            self::OPERATOR_GREATER_THAN_EQUAL,
            self::OPERATOR_LOWER_THAN,
            self::OPERATOR_LOWER_THAN_EQUAL,
        );

        if ($includeSelector) {
            $values[] = self::OPERAND_SELECTOR;
        }

        return $values;
    }
1232647
@When("^I de-select every item on the element on index '(\\d+?)'$")
    public void elementDeSelect(Integer index) {
        Select sel = null;
        sel = new Select(commonspec.getPreviousWebElements().getPreviousWebElements().get(index));

        if (sel.isMultiple()) {
            sel.deselectAll();
        }
    }
1142450
public ElementActionBuilder select(String ... options) {
        DropDownSelectAction action = new DropDownSelectAction();
        action.setOptions(Arrays.asList(options));
        action(action);
        return new ElementActionBuilder(action);
    }
473777
protected function configureSelector(
        DocumentSelector $selector,
        array $aggregation
    ): DocumentSelector {
        //@see AggregationDefinition
        $query = $aggregation[2];

        //Mounting selection values
        array_walk_recursive($query, function (&$value) {
            if (strpos($value, 'self::') === 0) {
                $value = $this->findValue(substr($value, 6));
            }
        });

        return $selector->where($query);
    }
457972
public function dragAndDropToObject($sSelector, $sContainer)
    {
        $oElement = $this->getElementLazy($sSelector);
        $oContainer = $this->getElementLazy($sContainer);

        $oElement->dragTo($oContainer);
    }
1060010
protected function _getElementByIdOrName($sSelector)
    {
        $sSelector = str_replace(array('name=', 'id='), array('', ''), $sSelector);

        if (strpos($sSelector, '.') || strpos($sSelector, '[')) {
            $oElement = $this->_getElementByIdOrNameXpath($sSelector);
        } else {
            $oElement = $this->_getElementByIdOrNameCSS($sSelector);
        }

        return $oElement;
    }
781513
private void addInstSelect(final Select _select, final AbstractDataElement<?> _element, final Object _attrOrClass,
                               final Type _currentType)
        throws CacheReloadException
    {
        if (StringUtils.isNotEmpty(_element.getPath()) && !this.instSelects.containsKey(_element.getPath())) {
            final Select instSelect = Select.get();
            for (final AbstractElement<?> selectTmp : _select.getElements()) {
                if (!selectTmp.equals(_element)) {
                    if (selectTmp instanceof LinktoElement) {
                        instSelect.addElement(new LinktoElement().setAttribute(((LinktoElement) selectTmp)
                                        .getAttribute()));
                    } else if (selectTmp instanceof LinkfromElement) {
                        instSelect.addElement(new LinkfromElement().setAttribute(((LinkfromElement) selectTmp)
                                        .getAttribute()).setStartType(((LinkfromElement) selectTmp).getStartType()));
                    } else if (selectTmp instanceof ClassElement) {
                        instSelect.addElement(new ClassElement()
                                        .setClassification(((ClassElement) selectTmp).getClassification())
                                        .setType(((ClassElement) selectTmp).getType()));
                    } else if (selectTmp instanceof AttributeSetElement) {
                        instSelect.addElement(new AttributeSetElement()
                                        .setAttributeSet(((AttributeSetElement) selectTmp).getAttributeSet())
                                        .setType(((ClassElement) selectTmp).getType()));
                    }
                }
            }
            if (_element instanceof LinkfromElement) {
                instSelect.addElement(new LinkfromElement().setAttribute((Attribute) _attrOrClass).setStartType(
                                _currentType));
                instSelect.addElement(new InstanceElement(((Attribute) _attrOrClass).getParent()));
            } else if (_element instanceof LinktoElement) {
                instSelect.addElement(new LinktoElement().setAttribute((Attribute) _attrOrClass));
                instSelect.addElement(new InstanceElement(_currentType));
            } else if (_element instanceof ClassElement) {
                instSelect.addElement(new ClassElement().setClassification((Classification) _attrOrClass)
                                .setType(_currentType));
                instSelect.addElement(new InstanceElement((Type) _attrOrClass));
            } else if (_element instanceof AttributeSetElement) {
                instSelect.addElement(new AttributeSetElement().setAttributeSet((AttributeSet) _attrOrClass)
                                .setType(_currentType));
                instSelect.addElement(new InstanceElement((Type) _attrOrClass));
            }
            this.instSelects.put(_element.getPath(), instSelect);
        }
    }
912011
public function removeSelector($mSelector) {
		if($mSelector instanceof Selector) {
			$mSelector = $mSelector->getSelector();
		}
		foreach($this->aSelectors as $iKey => $oSelector) {
			if($oSelector->getSelector() === $mSelector) {
				unset($this->aSelectors[$iKey]);
				return true;
			}
		}
		return false;
	}
353507
public function getSelectedIndex($sSelector)
    {
        $oSelect = $this->getElementLazy($sSelector);
        $sValue = $oSelect->getValue();
        $oOptions = $oSelect->findAll('css', "option");
        foreach ($oOptions as $iKey => $oOption) {
            if ($oOption->getValue() == $sValue) {
                return $iKey;
            }
        }
        return $oSelect->getText();
    }
73797
public function plainSelect($name, $list = array(), $selected = null, $options = array())
    {
        return parent::select($name, $list, $selected, $options);
    }
979355
public function setTargetSelector($_targetSelector) {
		if(!\is_array($_targetSelector)){
			$_targetSelector=["edit"=>$_targetSelector,"delete"=>$_targetSelector];
		}
		$this->_targetSelector=$_targetSelector;
		return $this;
	}
529626
public function select($pSelectStatement)
    {
        $returnValue = null;
        try {
            // Set the select.
            $stmt = $this->pdo->prepare($pSelectStatement);
            // Call the database routine
            $stmt->execute();
            // Fetch all rows into an array.
            $rows = $stmt->fetchAll(\PDO::FETCH_ASSOC);

            if ($this->isArray($rows)) {
                $returnValue = $rows;
            }

            $stmt->closeCursor();
        } catch (Exception $pError) {
            $message = \sprintf(
                'Select statement failed "%s" in %s on line %s',
                $pSelectStatement,
                $pError->getFile(),
                $pError->getLine()
            );

            throw new \Exception($message, 501, $pError);
        }

        return $returnValue;
    }
1090381
@Override
    public void deselectAllOptions() throws WidgetException {
        try {
            org.openqa.selenium.support.ui.Select selectBox = new org.openqa.selenium.support.ui.Select(
                    findElement());
            selectBox.deselectAll();
        } catch (Exception e) {
            throw new WidgetException("Error while deselecting all selected options", getByLocator(),
                    e);
        }
    }
701147
public function multiselect(String $name = NULL, Array $options = [], $selected = NULL, Array $_attributes = [])
    {
        return $this->select($name, $options, $selected, $_attributes, true);
    }
54335
public function isVisible($sSelector)
    {
        $element = $this->getElement($sSelector, false);
        return $element && $element->isVisible();
    }
670263
public function getAvailableSitesSelector(
        $selectorName,
        Site $selectedSite = null
    ) {
        $siteRepository = GeneralUtility::makeInstance(SiteRepository::class);

        $sites = $siteRepository->getAvailableSites();
        $selector = '<select name="' . htmlspecialchars($selectorName) . '" class="form-control">';

        foreach ($sites as $site) {
            $selectedAttribute = '';
            if ($selectedSite !== null && $site->getRootPageId() === $selectedSite->getRootPageId()) {
                $selectedAttribute = ' selected="selected"';
            }

            $selector .= '<option value="' . htmlspecialchars($site->getRootPageId()) . '"' . $selectedAttribute . '>'
                . htmlspecialchars($site->getLabel())
                . '</option>';
        }

        $selector .= '</select>';

        return $selector;
    }