Skip to content

Instantly share code, notes, and snippets.

@ckenst
Last active November 29, 2017 22:18
Show Gist options
  • Save ckenst/47e2b92ca9548aeb10554c835c5b4c37 to your computer and use it in GitHub Desktop.
Save ckenst/47e2b92ca9548aeb10554c835c5b4c37 to your computer and use it in GitHub Desktop.
Debugging a Selenium Test using binding.pry
require 'pry' # Add to gemfile if not already there
# Not a functioning test
# Also not the greatest example
def run
setup
yield
teardown
end
run do
@driver.get 'http://www.kenst.com/about'
binding.pry # Test will pause here during run. You'll see debug info in console. Pressing enter will resume test.
expect(@driver.title).to eql "About – Chris Kenst's Blog"
@driver.save_screenshot(File.join(Dir.pwd, "headless.png"))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment