5

SeleniumRubyWindowsTest.rb:1:in `require': no such file to load -- selenium (Loa dError) from SeleniumRubyWindowsTest.rb:1

I followed the steps from this blog - http://testnerdy.blogspot.ca/2009/10/installing-ruby-and-selenium-on-windows.html

This blog is a little dated, so I am assuming it has to do with that. Anyone have any ideas on what I may be doing wrong?

Code as requested (this is copy/pasted from http://testnerdy.blogspot.ca/2009/10/running-selenium-tests-written-in-ruby.html)

require "selenium"
require "test/unit"

class SeleniumRubyWindowsTest < Test::Unit::TestCase
  def setup
    @verification_errors = []
    if $selenium
      @selenium = $selenium
    else
      @selenium = Selenium::SeleniumDriver.new("localhost", 4444, "*chrome", "http://www.yahoo.com/", 10000);
      @selenium.start
    end
    @selenium.set_context("SeleniumRubyWindowsTest")
  end

  def teardown
    @selenium.stop unless $selenium
    assert_equal [], @verification_errors
  end

  def test_SeleniumRubyWindowsTest
    @selenium.open "/"
    assert_equal "Yahoo!", @selenium.get_title
    @selenium.type "p_13838465-p", "Selenium RC"
    @selenium.click "search-submit"
    @selenium.wait_for_page_to_load "30000"
    assert_equal "Selenium RC - Yahoo! Search Results", @selenium.get_title
  end
end
  • what file are you referencing at line 1 ? Is it there ? Can you include your code ? – Phil Kirkham Aug 8 '12 at 15:15
  • what happens if you open up irb and type "require 'selenium' " ? – Phil Kirkham Aug 8 '12 at 20:34
  • irb(main):001:0> require "selenium" LoadError: cannot load such file -- selenium from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from (irb):1 from C:/RailsInstaller/Ruby1.9.3/bin/irb:12:in `<main>' does this mean I have a bad install? – Letstestthisfast Aug 8 '12 at 22:58
  • seems so - what happens if you do 'gem uninstall Selenium' ? – Phil Kirkham Aug 8 '12 at 23:48
  • if that works, do 'gem install Selenium' – Phil Kirkham Aug 8 '12 at 23:49
3

Seems my suggestion of doing a gem uninstall and then an install worked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.