public function switchToWindow($name = null) { $this->saveScreenshot(); parent::switchToWindow($name); $this->saveScreenshot(); }