我正在尝试使用Bewildr,Cucumber和IronRuby来自动化WPF。截至目前,作为婴儿步骤,我已经完成了以下工作
在 C:\IronRuby 中安装了 IronRuby1.1安装的迷惑和黄瓜宝石
在 IronRuby bin 中创建了一个 Ruby 文件样本.rb
require 'rubygems'
require 'bewildr'
@app, @main_window = Bewildr::Application.start_app_and_wait_for_window("C:\Documents and Settings\321106\Desktop\ExpenseItStandalone.exe", /App v1.d+/)
当我在cmd提示符下执行它时使用
ruby sample.rb
我收到以下错误:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/bewildr-0.1.14/lib/bewildr.rb:7:in `<top (required)>': Bewildr only works under IronRuby (LoadError)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from adding_steps.rb:3:in `<main>'
你正试图在普通的红宝石中迷惑不解。你需要使用IronRuby。而不是:
ruby sample.rb
尝试:
ir sample.rb