lib/Remote/RemoteWebDriver.php
public function takeScreenshot($save_as = null)
    {
        $screenshot = base64_decode(
            $this->execute(DriverCommand::SCREENSHOT)
        );
        if ($save_as) {
            file_put_contents($save_as, $screenshot);
        }

        return $screenshot;
    }
public function takeScreenshot($save_as = null)
    {
        $screenshot = base64_decode(
            $this->execute(DriverCommand::SCREENSHOT)
        );
        if ($save_as) {
            file_put_contents($save_as, $screenshot);
        }

        return $screenshot;
    }
public function takeScreenshot ( $ save_as = null ) { $ screenshot = base64_decode ( $ this -> execute ( DriverCommand :: SCREENSHOT ) ) ; if ( $ save_as ) { file_put_contents ( $ save_as , $ screenshot ) ; } return $ screenshot ; }
Take a screenshot of the current page.

@param string $save_as The path of the screenshot to be saved.
@return string The screenshot in PNG format.
Take a screenshot of the current page .