点击方法抛出"' instanceof'的右侧不可赎回"

时间:2016-11-01 09:54:58

标签: ruby watir-webdriver selenium-chromedriver

我正在尝试在此网址中提交表单" http://www.paisabazaar.com/personal-loan"使用ruby(watir-webdriver gem)脚本。我可以使用脚本填写表单,但我无法点击复选框和提交按钮。

以下是规格

铬= 54.0.2840.71
chromedriver = 2.25.426923
watir-webdriver(0.9.3,0.9.1)
ruby version = ruby​​ 2.2.4p230(2015-12-16修订版53155)[x64-mingw32]
宝石版= 2.6.8
OS = Windows 7

脚本:

require 'watir-webdriver'
$browser=Watir::Browser.new :chrome
$browser.goto "http://www.paisabazaar.com/personal-loan"
$browser.text_field(:id,'loan_amount').send_keys "400000"
$browser.text_field(:id,'monthly_income').send_keys "90000"
$browser.text_field(:id,'email').send_keys "xyz@domain.com"
$browser.text_field(:id,'mobile_number').send_keys "898989898989"
$browser.button(:id,'submit_first_step').click

错误:

Selenium::WebDriver::Error::UnknownError: unknown error: Right-hand side of 'instanceof' is not callable
  (Session info: chrome=54.0.2840.71)
  (Driver info: chromedriver=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed),platform=Windows NT 6.1.7601 SP1 x86_64)
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/remote/response.rb:70:in `assert_ok'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/remote/response.rb:34:in `initialize'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/remote/http/common.rb:78:in `new'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/remote/http/common.rb:78:in `create_response'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/remote/http/default.rb:90:in `request'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/remote/http/common.rb:59:in `call'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/remote/bridge.rb:649:in `raw_execute'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/remote/bridge.rb:627:in `execute'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/remote/bridge.rb:389:in `clickElement'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/common/element.rb:73:in `click'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/watir-webdriver-0.9.1/lib/watir-webdriver/elements/element.rb:128:in `block in click'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/watir-webdriver-0.9.1/lib/watir-webdriver/elements/element.rb:598:in `element_call'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/watir-webdriver-0.9.1/lib/watir-webdriver/elements/element.rb:117:in `click'
        from (irb):7
        from C:/Ruby22-x64/bin/irb:11:in `<main>'

只有点击方法(在irb中签入)才会出现此错误。请检查并告诉我这个问题的发生和解决方案。提前谢谢。

1 个答案:

答案 0 :(得分:3)

它似乎是chromedriver中尚未解决的错误。 https://bugs.chromium.org/p/chromedriver/issues/detail?id=1388 我建议在那里添加可重现的测试用例。