On Sat, Jan 21, 2012 at 19:17, Daniel K. <tswbyaj / gmail.com> wrote:

> So I'm trying to run this script
[snip]
> And I get this response when I run it.
>
> seleniumtest_script.rb:24:in `ensure in <main>': undefined method
> `close_current_browser_session' for nil:NilClass (NoMethodError)
> from seleniumtest_script.rb:24:in `<main>'
>
> So my question is, what am I missing?

Assuming that what you've posted is indeed seleniumtest_script.rb, and
that line 24 is indeed the one where you do
"@browser.close_current_browser_session" (even though you have fewer
than 24 lines of code there!), @browser is nil.  Any time you see
"undefined method `some_method' for nil:NilClass" that means that
you've tryied to call some_method on an object that's actually nil.

Now the question is, why is it nil?  Most likely your call to
"@browser = Selenium::Client::Driver.new" (with the args on further
lines) is failing.

So now the question is, why is that failing?  That is left as an
exercise for the reader.  ;-)

-Dave

-- 
Dave Aronson, President, Dave Aronson Software Engineering and Training
Ruby on Rails Freelancing (Northern Virginia, Washington DC, or Remote)
DaveAronson.com, Codosaur.us, Dare2XL.com, & RecruitingRants.com (NEW!)
Specialization is for insects. (Heinlein) - Have Pun, Will Babble! (me)