Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TraversableElement.php

function TraversableElement::pressButton

Presses button (input[type=submit|image|button|reset], button) with specified locator.

Parameters

string $locator button id, value or alt:

Return value

void

Throws

ElementNotFoundException

File

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

Class

TraversableElement
Traversable element.

Namespace

Behat\Mink\Element

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal