protected function createScreenshot()
    {
        $image = imagecreatefromstring($this->webDriver->screenshotAsImage());
        if (false === $image) {
            throw new WebDriver_Exception("Invalid screenshot data");
        }
        return $image;
    }
protected function createScreenshot()
    {
        $image = imagecreatefromstring($this->webDriver->screenshotAsImage());
        if (false === $image) {
            throw new WebDriver_Exception("Invalid screenshot data");
        }
        return $image;
    }
protected function createScreenshot ( ) { $ image = imagecreatefromstring ( $ this -> webDriver -> screenshotAsImage ( ) ) ; if ( false === $ image ) { throw new WebDriver_Exception ( "Invalid screenshot data" ) ; } return $ image ; }
Takes screenshot and returns image resource.

@return resource
@throws WebDriver_Exception
Takes screenshot and returns image resource .