jarmo / RAutomation

RAutomation
MIT License
100 stars 33 forks source link

Automating a WPF Application works on Windows 7 but fails on Windows Server 2012 -> UiaDll.dll LoadError #98

Closed rabos5 closed 9 years ago

rabos5 commented 9 years ago

As the title says, the small script sample below works great on a Windows 7 machine. When I install ruby, the same gems and gem versions used on the Win7 machine on a Windows Server 2012 machine and run the same script, I encounter the LoadError below.

I'm a bit lost as to what to look for next. I did check the .Net framework versions on both machines and they are the same. The only thing that seems to be different is the Windows edition/version. Any thoughts on what to look for or how to fix this to get it working? Let me know if you need more information.

Ruby Version: 2.0.0 ffi: 1.9.3-x86-mingw32 rautomation: 0.17

Ruby Code: require 'rautomation'

login_window_title = 'Log In - Window' login_window = RAutomation::Window.new(:title => login_window_title, :adapter => :ms_uia) user_name_txt = login_window.value_control(:id => 'UserName') user_name_txt.set 'username'

Error stack trace: LoadError: Could not open library 'C:/Ruby200/lib/ruby/gems/2.0.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms_uia /../../../../ext/UiaDll/Release/UiaDll.dll': The specified module could not be found.

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ffi-1.9.3-x86-mingw32/lib/ffi/library.rb:133:in block in ffi_lib' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ffi-1.9.3-x86-mingw32/lib/ffi/library.rb:100:inmap' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ffi-1.9.3-x86-mingw32/lib/ffi/library.rb:100:in ffi_lib' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms_uia/uia_dll.rb:116:inmodule:UiaDll' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms_uia/uia_dll.rb:7:in <module:MsUia>' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms_uia/uia_dll.rb:6:inmodule:Adapter' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms_uia/uia_dll.rb:5:in <module:RAutomation>' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms_uia/uia_dll.rb:4:in<top (required)>' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms_uia/value_control.rb:13:in set' from (irb):6 from C:/Ruby200/bin/irb:12:in

'

Thanks in advance for your help!

Ryan

leviwilson commented 9 years ago

My guess is that you need to install the Visual C++ 2010 Runtime on that server (as mentioned in issue #81).

rabos5 commented 9 years ago

Thanks Levi... I actually did read that issue, believe it or now :), prior to submitting this one. I did some checking around and was under the impression the Windows 2012 server I had spun up did come with Microsoft Visual C++ 2010 already installed (since it was a package option I had selected before deploying it). Just to double check with what you said, I did install it using this link (http://www.microsoft.com/en-us/download/details.aspx?id=5555) and my script is now working successfully.

Thanks for the quick response as always!

Ryan