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;
    }