2017-02-20 2 views
1
I am trying to run this below code, then I got code error: 

рубин/2.3.0/RubyGems/core_ext /kernel_require.rb:55:in `требуют ': не может загрузить такой файл - селеном WebDriver (LoadError)рубин/2.3.0/RubyGems/core_ext/kernel_require.rb: 55: в `требуется ': не может загрузить такой файл - селеном WebDriver (LoadError)

Я не могу найти то, что мне не хватает, пожалуйста, помогите мне с этим

require "selenium-webdriver" 

# Firefox browser instantiation 
driver = Selenium::WebDriver.for :firefox 

#Loading the assertselenium URL 
driver.navigate.to "http://www.assertselenium.com" 

#Clicking on the Follow link present on the assertselenium home page 
FollowButton = driver.find_element(:link, "Follow") 
FollowButton.click 

#Typing the UserName 
LoginButton = driver.find_element(:id, "user_login") 
LoginButton.send_keys "sampleuser77dff27" 

#Typing the Email-Id 
EmailId = driver.find_element(:id, "user_email") 
EmailId.send_keys "[email protected]" 

#Clicking on the Submit Button 
SubmitButton = driver.find_element(:id, "wp-submit") 
SubmitButton.click 

#Asserting whether the registration success message is diaplyed 
SuccessMessage = driver.find_element(:css, "p.message") 
"Registration complete. Please check your e-mail.".eql? SuccessMessage.text 
puts "Successfully completed the user registration and validated the Success message" 
#Quitting the browser 
driver.quit 
+0

Есть много возможных ответов, которые можно найти в Google. не могли бы вы сообщить нам, почему они вам не помогают? – Burki

ответ

0

Попробуйте добавить:

require 'rubygems' 

наверху этого сценария. Если вы по-прежнему получаете ту же ошибку, то установите драгоценный камень:

gem install selenium-webdriver 

Надеюсь, что это поможет.

-1

Я открыл несколько проектов, когда получил ошибку «Ядро-требует». Затем я открыл свой проект в отдельном окне, и я снова использовал инструкцию require. Это сработало для меня.

Смежные вопросы