Skip to content

Instantly share code, notes, and snippets.

@inkredabull
Created October 5, 2012 21:03
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 inkredabull/3842392 to your computer and use it in GitHub Desktop.
Save inkredabull/3842392 to your computer and use it in GitHub Desktop.
Use execute_script in conjunction with evaluate_script to flush JS global to STDOUT
# Essentially from the poltergeist code (see 'spec/integration/driver_spec.rb')
page.execute_script("window.result = 3;")
puts page.evaluate_script("result") # '3'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment