You are here

public function TraversableElement::clickLink in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/behat/mink/src/Element/TraversableElement.php \Behat\Mink\Element\TraversableElement::clickLink()

Clicks link with specified locator.

Parameters

string $locator link id, title, text or image alt:

Throws

ElementNotFoundException

File

vendor/behat/mink/src/Element/TraversableElement.php, line 65

Class

TraversableElement
Traversable element.

Namespace

Behat\Mink\Element

Code

public function clickLink($locator) {
  $link = $this
    ->findLink($locator);
  if (null === $link) {
    throw new ElementNotFoundException($this
      ->getDriver(), 'link', 'id|title|alt|text', $locator);
  }
  $link
    ->click();
}