zoukankan      html  css  js  c++  java
  • Watir问题--LoadError: cannot load such file -- watir-classic

    在执行下面程序,报错

    require 'watir'
    ie=page = Watir::Browser.new :ie
    ie.goto "www.google.com"

    报的错误:

    C:Userszxy>irb
    DL is deprecated, please use Fiddle
    irb(main):001:0> require "watir"
    => true
    irb(main):002:0> ie=page = Watir::Browser.new :ie
    LoadError: cannot load such file -- watir-classic
            from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require'
            from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require'
            from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/watir-5.0.0/lib/watir/loader.rb:41:in `load_dri
    ver'
            from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/watir-5.0.0/lib/watir/loader.rb:33:in `load_dri
    ver_for'
            from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/watir-5.0.0/lib/watir/loader.rb:6:in `initializ
    e'
            from (irb):2:in `new'
            from (irb):2
            from C:/Ruby200-x64/bin/irb:12:in `<main>'
    irb(main):003:0> exit

    原因分析:是由于Watir::Browser 是在watir-webdriver模块中

    解决办法,在程序中引入 watir-webdriver 模块就ok了,加入watir-webdriver模块后的代码如下:

    require 'watir'
    require 'watir-webdriver'
    ie=page = Watir::Browser.new :ie
    ie.goto "www.google.com"
  • 相关阅读:
    poj1579
    poj1517
    poj1519
    poj1151
    poj1042
    AmCharts Flash 图形报表工具
    DataTable,List和Json的装换
    Indexing Service OpenQuery()
    MSSQL获取当前插入的ID号及在高并发的时候处理方式
    SQL2005 索引优化(转)
  • 原文地址:https://www.cnblogs.com/CI131204/p/3477063.html
Copyright © 2011-2022 走看看