Lines Matching refs:option
39 return $this->element->findElements(WebDriverBy::tagName('option'));
45 foreach ($this->getOptions() as $option) {
46 if ($option->isSelected()) {
47 $selected_options[] = $option;
60 foreach ($this->getOptions() as $option) {
61 if ($option->isSelected()) {
62 return $option;
71 foreach ($this->getOptions() as $option) {
72 if ($option->getAttribute('index') === (string) $index) {
73 $this->selectOption($option);
79 throw new NoSuchElementException(sprintf('Cannot locate option with index: %d', $index));
85 $xpath = './/option[@value = ' . XPathEscaper::escapeQuotes($value) . ']';
88 foreach ($options as $option) {
89 $this->selectOption($option);
98 sprintf('Cannot locate option with value: %s', $value)
106 $xpath = './/option[normalize-space(.) = ' . XPathEscaper::escapeQuotes($text) . ']';
109 foreach ($options as $option) {
110 $this->selectOption($option);
120 foreach ($this->getOptions() as $option) {
121 if ($option->getText() === $text) {
122 $this->selectOption($option);
133 sprintf('Cannot locate option with text: %s', $text)
141 $xpath = './/option[contains(normalize-space(.), ' . XPathEscaper::escapeQuotes($text) . ')]';
144 foreach ($options as $option) {
145 $this->selectOption($option);
154 sprintf('Cannot locate option with text: %s', $text)
165 foreach ($this->getOptions() as $option) {
166 $this->deselectOption($option);
176 foreach ($this->getOptions() as $option) {
177 if ($option->getAttribute('index') === (string) $index) {
178 $this->deselectOption($option);
191 $xpath = './/option[@value = ' . XPathEscaper::escapeQuotes($value) . ']';
193 foreach ($options as $option) {
194 $this->deselectOption($option);
204 $xpath = './/option[normalize-space(.) = ' . XPathEscaper::escapeQuotes($text) . ']';
206 foreach ($options as $option) {
207 $this->deselectOption($option);
217 $xpath = './/option[contains(normalize-space(.), ' . XPathEscaper::escapeQuotes($text) . ')]';
219 foreach ($options as $option) {
220 $this->deselectOption($option);
225 * Mark option selected
226 * @param WebDriverElement $option
228 protected function selectOption(WebDriverElement $option)
230 if (!$option->isSelected()) {
231 $option->click();
236 * Mark option not selected
237 * @param WebDriverElement $option
239 protected function deselectOption(WebDriverElement $option)
241 if ($option->isSelected()) {
242 $option->click();