不能在Watir-加载错误中使用browser.send_keys(“{tab}”)

时间:2012-06-13 10:48:26

标签: watir watir-webdriver

我无法使用Watir识别Rich TextBox。所以我尝试使用browser.send_keys(“{tab}”)按Tab键。但这会产生错误。我尝试卸载ffi-1.0.10-x86-mingw32.gem并安装ffi -v 1.0.9,但这不起作用。我收到这样的错误:

irb(main):013:0> browser.send_keys("{tab}")
LoadError: cannot load such file -- ffi_c
        from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.10-x86-mingw32/lib/ffi.rb:11:in `rescue in <top (required)>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.10-x86-mingw32/lib/ffi.rb:2:in `<top (required)>'
        from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32.rb:6:in `<top (required)>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/window.rb:67:in `const_get'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/window.rb:67:in `initialize'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-class.rb:456:in `new'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-class.rb:456:in `rautomation'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-class.rb:475:in `send_keys'
        from (irb):13
        from C:/Ruby193/bin/irb:12:in `<main>'
irb(main):014:0>

我使用Watir 3.0.0, Ruby 1.9.3。

宝石:

  • bigdecimal(1.1.0)
  • builder(3.0.0)
  • commonwatir(3.0.0)
  • ffi(1.0.10 x86-mingw32)
  • hoe(3.0.6)
  • io-console(0.3)
  • json(1.5.4)
  • minitest(2.5.1)
  • nokogiri(1.5.3 x86-mingw32)
  • rake(0.9.2.2)
  • rautomation(0.7.2)
  • rdoc(3.9.4)
  • ruby​​gems-update(1.8.24)
  • s4t-utils(1.0.4)
  • 用户选择(1.1.6.1)
  • watir(3.0.0,1.5.3)
  • watir-classic(3.0.0)
  • win32-api(1.4.8)
  • win32-process(0.6.5)
  • windows-api(0.4.1)
  • windows-pr(1.2.1)
  • xml-simple(1.1.1)

1 个答案:

答案 0 :(得分:2)

尝试:

browser.send_keys :tab

我相信Watir 3.0将send_keys方法更改为Watir-Webdriver中的方法 - 请参阅http://watirmelon.com/tag/send_keys/