Skip to content

Instantly share code, notes, and snippets.

@DanielHeath
Created March 19, 2012 06:16
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 DanielHeath/2098515 to your computer and use it in GitHub Desktop.
Save DanielHeath/2098515 to your computer and use it in GitHub Desktop.
Chromedriver / webdriver

Just a little example to demonstrate a feature request.

source "http://rubygems.org/"
gem 'selenium-webdriver'
GEM
remote: http://rubygems.org/
specs:
childprocess (0.3.1)
ffi (~> 1.0.6)
ffi (1.0.11)
multi_json (1.1.0)
rubyzip (0.9.6.1)
selenium-webdriver (2.20.0)
childprocess (>= 0.2.5)
ffi (~> 1.0)
multi_json (~> 1.0)
rubyzip
PLATFORMS
ruby
DEPENDENCIES
selenium-webdriver
#!/usr/bin/env ruby
require 'selenium-webdriver'
require 'ruby-debug'
foo = Selenium::WebDriver.for(:chrome)
foo.navigate.to("http://samplepdf.com/sample.pdf")
puts "Expected a pdf binary, but got:"
puts foo.page_source
# Expected a pdf binary, but got:
# "<html><body marginwidth=\"0\" marginheight=\"0\" style=\"background-color: rgb(38,38,38)\"><embed width=\"100%\" height=\"100%\" name=\"plugin\" src=\"http://samplepdf.com/sample.pdf\" type=\"application/pdf\"></body></html>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment