lib/Remote/RemoteTargetLocator.php
public function frame($frame)
    {
        if ($frame instanceof WebDriverElement) {
            $id = ['ELEMENT' => $frame->getID()];
        } else {
            $id = (string) $frame;
        }

        $params = ['id' => $id];
        $this->executor->execute(DriverCommand::SWITCH_TO_FRAME, $params);

        return $this->driver;
    }
public function frame($frame)
    {
        if ($frame instanceof WebDriverElement) {
            $id = ['ELEMENT' => $frame->getID()];
        } else {
            $id = (string) $frame;
        }

        $params = ['id' => $id];
        $this->executor->execute(DriverCommand::SWITCH_TO_FRAME, $params);

        return $this->driver;
    }
public function frame ( $ frame ) { if ( $ frame instanceof WebDriverElement ) { $ id = [ 'ELEMENT' => $ frame -> getID ( ) ] ; } else { $ id = ( string ) $ frame ; } $ params = [ 'id' => $ id ] ; $ this -> executor -> execute ( DriverCommand :: SWITCH_TO_FRAME , $ params ) ; return $ this -> driver ; }
Switch to the iframe by its id or name.

@param WebDriverElement|string $frame The WebDriverElement,
the id or the name of the frame.
@return WebDriver The driver focused on the given frame.
Switch to the iframe by its id or name .