diff --git a/src/Browser.php b/src/Browser.php index dc9ed175d..c8327dc97 100644 --- a/src/Browser.php +++ b/src/Browser.php @@ -270,10 +270,10 @@ public function fitContent() { $this->driver->switchTo()->defaultContent(); - $body = $this->driver->findElement(WebDriverBy::tagName('body')); + $html = $this->driver->findElement(WebDriverBy::tagName('html')); - if (! empty($body)) { - $this->resize($body->getSize()->getWidth(), $body->getSize()->getHeight()); + if (! empty($html)) { + $this->resize($html->getSize()->getWidth(), $html->getSize()->getHeight()); } return $this;