Skip to content

Instantly share code, notes, and snippets.

@ppadron
Created September 25, 2012 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ppadron/3784276 to your computer and use it in GitHub Desktop.
Save ppadron/3784276 to your computer and use it in GitHub Desktop.
<?php
require_once 'php-webdriver/lib/WebDriver/ClassLoader.php';
$driver = new WebDriver("http://localhost:4444/wd/hub");
$session = $driver->session('chrome');
$session->open('http://google.com/');
// $session->window('current')->postSize(array('width' => 1024, 'height' => 4*1024));
file_put_contents('banana.png', $session->screenshot());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment