Selenium/Ruby/Debugging

Interactive exploration
Watir in particular (even before Selenium existed) was always intended to be used interactively as well as batch-wise. Use irb, the interactive Ruby shell: If you get "Server not found" the first time you run browser.goto, try repeating the command. At this point your browser has the page open and you can zoom around in it in some really spectacular ways. A place to start looking is https://github.com/watir/watir/wiki/Using-IRB, but there is a lot more available.

Breaking into a debugger
The suggestion to use pry-nav in https://groups.google.com/forum/#!topic/watir-general/fFeBBU6n2jw (where Zejlko contributed!) worked:


 * 1) add gem "pry-nav" to Gemfile
 * 2) run bundle install
 * 3) insert
 * in the step_definition where you want it to stop.

Now execute your cucumber command as normal and it will break into a debugger with next, step , and continue commands

Problem areas
ERROR: Error installing ruby-debug: ERROR: Failed to build gem native extension. /home/spage/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb  Can't handle 1.9.x yet
 * How to get irb to load a PageObject from features/support/pages
 * How to get irb to run the cucumber command line.
 * Suggestions requiring ruby-debug such as http://www.agileforall.com/2011/12/cucumber-tip-irb-from-inside-a-step-definition/ failed with