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

Breadcrumb

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

function Selenium2Driver::switchToIFrame

Overrides CoreDriver::switchToIFrame

File

vendor/lullabot/mink-selenium2-driver/src/Selenium2Driver.php, line 486

Class

Selenium2Driver
Selenium2 driver.

Namespace

Behat\Mink\Driver

Code

public function switchToIFrame(?string $name = null) {
    if ($this->isW3C()) {
        if (empty($name)) {
            $this->getWebDriverSession()
                ->frame(array(
                'id' => null,
            ));
        }
        else {
            $frameElement = $this->findElement("//iframe[@name='{$name}']");
            $this->getWebDriverSession()
                ->frame(array(
                'id' => [
                    Element::WEB_ELEMENT_ID => $frameElement->getID(),
                ],
            ));
        }
    }
    else {
        $this->getWebDriverSession()
            ->frame(array(
            'id' => $name,
        ));
    }
}

API Navigation

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