Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uninitialized constant Selenium

Tags:

ruby

selenium

I'm trying to use the Selenium Webdriver gem to write a test but am getting the following error. "test.rb:4:in `': uninitialized constant Selenium (NameError)"

I can't seem to figure out why its giving me this error. I have pasted the code for the test below.

"require rubygems"
"require selenium-webdriver"

driver = Selenium::WebDriver.for :chrome

that is where it fails. The rest of the test is pretty page-specific js executions.

like image 830
sam Avatar asked Jan 12 '23 11:01

sam


1 Answers

Your requires do nothing, you just wrote unused String literals, change it to:

require "rubygems"
require "selenium-webdriver"
like image 169
mechanicalfish Avatar answered Jan 21 '23 06:01

mechanicalfish