基本上,我刚开始学on Rails的3使用Selenium,我开始与硒IDE和生成的RSpec格式LoadError使用Selenium时:没有这样的文件来加载 - 规格
剧本之前,我运行此脚本我已经安装的宝石selenium-client
,Selenium
,selenium-rails
和selenium-webdriver
但是,当我使用rspec的命令来运行该脚本,我得到了
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:58:in `require': no such file to load -- spec (LoadError)
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:58:in `rescue in require'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-client-1.2.18/lib/selenium/rspec/spec_helper.rb:2:in `<top (required)>'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/Users/qsang/Desktop/Code/NextBigThing/spec/Selenium/create_new_user.rb:5:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `load'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `block in load_spec_files'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `map'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `load_spec_files'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/command_line.rb:18:in `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:55:in `run_in_process'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:46:in `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:10:in `block in autorun'
我试图寻找答案,唯一的情况是我发现接近我的是Selenium Can't Find 'spec' Folder,这还没有人回答。
有人可以帮助我,请提前致谢。
我已经安装了Rspec,并通过执行'rails generate rspec:install'在我的项目文件夹下生成了一个spec文件夹。 'spec_helper'文件包含在这个文件中,我把它放在我的答案中http://stackoverflow.com/questions/5330867/loaderror-when-using-selenium-no-such-file-to-load-spec/5341873#5341873 – Souloikj 2011-04-01 15:21:04
感谢spec_helper澄清。 虽然我打算使用黄瓜和RSpec进一步开发此混合(rails/IIS)网站。我决定走低科技并使用测试/单元,因为Selenium可以转换为测试/单元以及RSpec。这很好,因为现有的Selenium测试不是非常“RSpec样”开始 - 而是他们更“测试/统一”;-) 这样我就可以完全独立运行这些测试,只有ruby或plop他们在rails应用程序结构中由rake运行。 – danv 2011-04-03 20:34:18