Closed ghost closed 8 years ago
I'm not sure why you're having this problem, but it might be caused by the fact that you're using 64bit Ruby. Can you try the same thing with using 32bit Ruby instead?
That's right. 32bit runs all right.
I am using rautomation to automate our windows application. However whenever I am trying to click on some button, it's throwing error message as specified below:
C:\Users\vagrant>gem list
* LOCAL GEMS *
bigdecimal (1.2.6) ffi (1.9.14 x86-mingw32) io-console (0.4.3) json (1.8.1) minitest (5.4.3) power_assert (0.2.2) psych (2.0.8) rake (10.4.2) rautomation (0.17.0) rdoc (4.2.0) require_all (1.3.3) test-unit (3.0.8) uia (0.6)
Ruby Version: ruby 2.2.3p173 (2015-08-18 revision 51636) [i386-mingw32] OS: Windows7 64 bit
irb(main):006:0> win = RAutomation::Window.new :title=>'Windows Task Manager', :adapter=>'ms_uia' => #<RAutomation::Window:0x2c7c9d8 @adapter="ms_uia", @window=#<RAutomation::Adapter::MsUia::Window:0x2c7c900 @cont ainer=#<RAutomation::Window:0x2c7c9d8 ...>, @locators={:index=>0, :title=>"Windows Task Manager"}>> irb(main):007:0> win.button(:name=>'Hello').exists? LoadError: Could not open library 'C:/Ruby22/lib/ruby/gems/2.2.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms _uia/../../../../ext/UiaDll/Release/UiaDll.dll': from C:/Ruby22/lib/ruby/gems/2.2.0/gems/ffi-1.9.14-x86-mingw32/lib/ffi/library.rb:147:in `block in ffi_lib'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/ffi-1.9.14-x86-mingw32/lib/ffi/library.rb:100:in `map'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/ffi-1.9.14-x86-mingw32/lib/ffi/library.rb:100:in `ffi_lib'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms_uia/uia_dll.rb:116:in
<module:UiaDll>' from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms_uia/uia_dll.rb:7:in
module:MsUia'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms_uia/uia_dll.rb:6:in `
Solved the issue by replacing Microsoft Visual C++ 2012 Redistributable Package (x86) with Microsoft Visual C++ 2010 Redistributable Package (x86)
Thanks
I've made a simple test, but my script fails with "Could not find 'ffi'" error. Thank you for any help!
Gets the failure:
gem env:
gem list