我已经通过终端运行我的测试一段时间了,没有任何问题。:
cucumber 创建\新建\Game.feature
其中包含以下内容:
Feature: Create New Game
Background:
Given I am logged in
Scenario: Cleanup & New Game 01
Then I Delete all test Games
还有 ruby :
Given(/^I am logged in$/) do
el = first("button[ttag='account_dropdown_btn']", :visible => true)
if el.nil?
logMeIn("user@user1.com","pa55w0rd")
end
end
logMeIn 定义为:
# Logs the user in with given credentials
def logMeIn(username, password)
page.driver.browser.manage.window.maximize
visit ENV['BASE_URL']
fill_in 'j_username', :with => username
fill_in 'j_password', :with => password
click_button 'Login'
end
从测试开始到现在,以上都没有改变。 今天,当我开始测试时,Firefox 一打开,我立即得到:
Background: # features/Create New Game.feature:4
Given I am logged in # features/step_definitions/Generic Steps.rb:1
arguments[0] is undefined (Selenium::WebDriver::Error::JavascriptError)
如您所见,它在第一行失败了。我不知道为什么。
我更新了我所有的 gem 以确保一切都是新鲜的,但这没有用。我认为这可能是浏览器问题,因为我的系统今天早上自动更新到 Firefox 35.0。我卸载并尝试了 34,但它仍然是同样的问题。所有代码均未更改。
我不知道还有什么其他错误配置会导致此问题,因为我没有进行任何更改。
谁能进一步帮助解决这个错误?
最佳答案
是的,问题出在 Firefox 35 上。降级到版本 34。也许这就是您降级的方式。我只是运行了新的 DMG 安装程序并确认覆盖了现有的应用程序。
直接链接:https://download-installer.cdn.mozilla.net/pub/firefox/releases/34.0.5/mac/en-US/Firefox%2034.0.5.dmg (链接引用自 https://support.mozilla.org/en-US/kb/install-older-version-of-firefox)
可在此处找到有关此问题的更多信息:https://code.google.com/p/selenium/issues/detail?id=8387
关于ruby - cucumber / capybara 错误:参数 [0] 未定义(Selenium::WebDriver::Error::JavascriptError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27960085/