在自动化中,我试图使用rautomation来处理窗口弹出。我已经安装了以下宝石:
ffi (1.9.0 x86-mingw32, 1.8.1 x86-mingw32)
rautomation (0.9.2)我试过以下几点:
require 'rautomation'
window = RAutomation::Window.new :title => "Opening rautomation-0.9.2.gem"
=> #<RAutomation::Window:0x2c4bd30 @adapter=:win_32, @window=#<RAutomation::Adapter::Win32::Window:0x2ccd7c8 @container=#<RAutomation::Windo
w:0x2c4bd30 ...>, @locators={:index=>0, :title=>"Opening rautomation-0.9.2.gem"}>>默认情况下,适配器没有设置为ffi (它被设置为win_32,我使用的是windows机器),因此我尝试将它设置为ffi:
window.hwnd
=> 1508532
new_window = RAutomation::Window.new :hwnd => 1508532, :adapter => :ffi但这会导致以下错误:
NameError: uninitialized constant RAutomation::Adapter::Ffi
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.9.2/lib/rautomation/window.rb:67:in `const_get'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.9.2/lib/rautomation/window.rb:67:in `initialize'
from (irb):7:in `new'
from (irb):7
from C:/Ruby193/bin/irb:12:in `<main>'以下是我的问题:
发布于 2013-07-20 08:38:37
这里的问题是:win_32是:ffi适配器的新名称。换句话说,您已经在使用正确的适配器,这就是为什么不能将它设置为使用:ffi适配器,因为这个名称不存在。
为什么首先要将其设置为:ffi?有没有一些过时的文档,你从哪里得到的想法这样做?
https://stackoverflow.com/questions/17740584
复制相似问题