gpt4 book ai didi

ruby - watir : Failed to get IEnum Interface

转载 作者:太空宇宙 更新时间:2023-11-03 16:58:13 24 4
gpt4 key购买 nike

我使用的是 Windows XP,我需要将 watir 与 ruby​​ 一起使用,安装非常顺利,我最后一次尝试是按照此处的说明进行操作 Failed WATIR installation Server 2003一切正常,除了这个“错误:为 builder-2.1.2 生成文档时”,然后安装完成,没有更多问题。

问题是当我尝试运行一个示例脚本来执行谷歌搜索时,调用 set 函数时出现错误,到目前为止我还没有找到任何有用的信息,如果有人可以帮助我那就太好了:)

顺便说一句,在这里http://www.mail-archive.com/wtr-general@rubyforge.org/msg07722.html他们说它与 WIN32OLE 有关,但他们没有解释如何修复它(或者至少我没明白 :s )

我安装的版本是

    ruby -v    ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]    gem env    RubyGems Environment:      - RUBYGEMS VERSION: 1.3.7      - RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]      - INSTALLATION DIRECTORY: c:/ruby/lib/ruby/gems/1.8      - RUBY EXECUTABLE: c:/ruby/bin/ruby.exe      - EXECUTABLE DIRECTORY: c:/ruby/bin      - RUBYGEMS PLATFORMS:        - ruby        - x86-mswin32-60      - GEM PATHS:         - c:/ruby/lib/ruby/gems/1.8         - C:/Documents and Settings/jamontoya/.gem/ruby/1.8      - GEM CONFIGURATION:         - :update_sources => true         - :verbose => true         - :benchmark => false         - :backtrace => false         - :bulk_threshold => 1000      - REMOTE SOURCES:         - http://rubygems.org/

错误

c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/locator.rb:119:in `each': failed to get IEnum Interface (RuntimeError)    HRESULT error code:0x80004002      No such interface supported       from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/locator.rb:119:in `locate'        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/container.rb:838:in `locate_input_element'        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/input_elements.rb:5:in `locate'        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/element.rb:54:in `assert_exists'        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/element.rb:315:in `enabled?'        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/element.rb:62:in `assert_enabled'        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/input_elements.rb:364:in `set'        from Search.rb:29

示例代码(Search.rb)我删除了注释和其他不必要的行

    require "watir"    test_site = "http://www.google.com"    browser = Watir::Browser.new    browser.goto test_site    browser.text_field(:name, "q").set("pickaxe")  # here is the error when set is called    browser.button(:name, "btnG").click    browser.close

gem 列表以防万一你需要知道

*** LOCAL GEMS ***activesupport (2.3.9)builder (2.1.2)commonwatir (1.6.6)firewatir (1.6.6)fxri (0.3.6)fxruby (1.6.12 mswin32)hoe (2.6.2)hpricot (0.6 mswin32)json_pure (1.4.6)log4r (1.0.5)nokogiri (1.4.3.1 x86-mswin32)rake (0.8.7, 0.7.3)rubyforge (2.0.4)rubygems-update (1.3.7)s4t-utils (1.0.4)sources (0.0.1)user-choices (1.1.6.1)watir (1.6.6)win32-api (1.4.6 x86-mswin32-60, 1.0.4 mswin32)win32-clipboard (0.4.3)win32-dir (0.3.2)win32-eventlog (0.4.6)win32-file (0.5.4)win32-file-stat (1.2.7)win32-process (0.6.2, 0.5.3)win32-sapi (0.1.4)win32-sound (0.4.1)windows-api (0.4.0, 0.2.0)windows-pr (1.0.9, 0.7.2)xml-simple (1.0.12)

最佳答案

Watir can't find IEnum interface您链接到的线程说:

my best suggestion is to uninstall and reinstall Ruby, then re-install Watir on top of the new Ruby

这也是我的建议。

关于 ruby - watir : Failed to get IEnum Interface,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3937816/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com