Checks checkbox with specified locator.

@param string $locator input id, name or label

@throws ElementNotFoundException
322538
public function checkField($locator)
    {
        $field = $this->findField($locator);

        if (null === $field) {
            throw new ElementNotFoundException($this->getDriver(), 'form field', 'id|name|label|value', $locator);
        }

        $field->check();
    }
584487
public function addLocator(LocatorInterface $locator, $id = null) {
		if ($id === null) {
			$this->_locators[] = $locator;
		} else {
			$this->_locators[$id] = $locator;
		}
		
		return $this;
	}
817808
public function findAll($selector, $locator)
	{
		$items = array();

		foreach ( $this->_nodes as $node ) {
			$items = array_merge($items, $node->findAll($selector, $locator));
		}

		return $items;
	}
1110213
public function selectorToXpath($selector, $locator)
    {
        if ('xpath' === $selector) {
            if (!is_string($locator)) {
                throw new \InvalidArgumentException('The xpath selector expects to get a string as locator');
            }

            return $locator;
        }

        return $this->getSelector($selector)->translateToXPath($locator);
    }
498644
public function getElement($locator, $selector='css')
    {
        $page = $this->minkContext->getSession()->getPage();
        $element = $page->find('css', $locator);
        return $element;
    }
495687
protected function locateElements()
	{
		$elements = $this->locator->findAll();

		if ( empty($elements) ) {
			throw new ElementNotFoundException('No elements found by selector: ' . (string)$this->locator);
		}

		return $elements;
	}
1182417
public function elementTextNotContains($selectorType, $selector, $text)
    {
        $element = $this->elementExists($selectorType, $selector);
        $actual = $element->getText();
        $regex = '/'.preg_quote($text, '/').'/ui';

        $message = sprintf(
            'The text "%s" appears in the text of the %s, but it should not.',
            $text,
            $this->getMatchingElementRepresentation($selectorType, $selector)
        );

        $this->assertElementText(!preg_match($regex, $actual), $message, $element);
    }
1313917
public function setLocator($class, $locator)
    {
        if(!false == $pos = strrpos($class, '\\'))
        {
            $namespace = substr($class, 0, $pos);
            $this->_namespaces[$namespace] = $locator;
        }

        return $this;
    }
187674
public function iSelectTheRadioButton($radioLabel)
    {
        $radioButton = $this->getSession()->getPage()->findField($radioLabel);
        if (null === $radioButton) {
            throw new ElementNotFoundException($this->getSession(), 'form field', 'id|name|label|value', $radioLabel);
        }
        $this->getSession()->getDriver()->click($radioButton->getXPath());
    }
1100906
public function isElementVisible(string $locator, int $timeout = 5): bool
    {
        try {
            $element = $this->findElement($locator, $timeout);

            return isset($element) && $element->isVisible();
        } catch (ElementNotFoundException $e) {
            return false;
        }
    }
860604
public static ExpectedCondition<Boolean> invisibilityOfElementLocated(final By locator) {
    return new ExpectedCondition<Boolean>() {
      @Override
      public Boolean apply(WebDriver driver) {
        try {
          return !(driver.findElement(locator).isDisplayed());
        } catch (NoSuchElementException e) {
          // Returns true because the element is not present in DOM. The
          // try block checks if the element is present but is invisible.
          return true;
        } catch (StaleElementReferenceException e) {
          // Returns true because stale element reference implies that element
          // is no longer visible.
          return true;
        }
      }

      @Override
      public String toString() {
        return "element to no longer be visible: " + locator;
      }
    };
  }
864689
public function iShouldSeeTitleOnTheBlogPostList($title)
    {
        $node = $this->getSession()->getPage()->find('xpath', sprintf('//h2[contains(., "%s")]', $title));

        if (is_null($node)) {
            throw new ElementNotFoundException($this->getSession(), 'Blog post title');
        }
    }
550723
public static ExpectedCondition<WebElement> presenceOfElementLocated(final By locator) {
    return new ExpectedCondition<WebElement>() {
      @Override
      public WebElement apply(WebDriver driver) {
        return driver.findElement(locator);
      }

      @Override
      public String toString() {
        return "presence of element located by: " + locator;
      }
    };
  }
1073526
public static ExpectedCondition<WebElement> visibilityOfOneOfElementsLocatedBy(final By locator) {
		return new ExpectedCondition<WebElement>() {
			@Override
			public WebElement apply(WebDriver driver) {
				for (WebElement element : driver.findElements(locator)) {
					if (element.isDisplayed()) {
						return element;
					}
				}
				return null;
			}

			@Override
			public String toString() {
				return "visibility of one of the elements located by " + locator;
			}
		};
	}
607719
public function fillInDrupalAutocomplete($locator, $text) {

    $session = $this->getSession();
    $el = $session->getPage()->findField($locator);

    if (empty($el)) {
      throw new ExpectationException('No such autocomplete element ' . $locator, $session);
    }

    // Set the text and trigger the autocomplete with a space keystroke.
    $el->setValue($text);

    try {
      $el->keyDown(' ');
      $el->keyUp(' ');

      // Wait for ajax.
      $this->getSession()->wait(1000, '(typeof(jQuery)=="undefined" || (0 === jQuery.active && 0 === jQuery(\':animated\').length))');
      // Wait a second, just to be sure.
      sleep(1);

      // Select the autocomplete popup with the name we are looking for.
      $popup = $session->getPage()->find('xpath', "//ul[contains(@class, 'ui-autocomplete')]/li/a[text() = '{$text}']");

      if (empty($popup)) {
        throw new ExpectationException('No such option ' . $text . ' in ' . $locator, $session);
      }

      // Clicking on the popup fills the autocomplete properly.
      $popup->click();
    }
    catch (UnsupportedDriverActionException $e) {
      // So javascript is not supported.
      // We did set the value correctly, so Drupal will figure it out.
    }

  }
318762
public function getLocator($locator)
    {
        $locatorId = Utilities::getEntityId(
            $locator,
            'WindowsAzure\MediaServices\Models\Locator'
        );

        return Locator::createFromOptions(
            $this->_getEntity("Locators('{$locatorId}')")
        );
    }
840122
public function pressButton($locator)
    {
        $button = $this->findButton($locator);

        if (null === $button) {
            throw new ElementNotFoundException($this->getDriver(), 'button', 'id|name|title|alt|value', $locator);
        }

        $button->press();
    }