Ocra“Watir::Safari 无法加载”
我收到此错误,但我的脚本根本不使用 safariwatir... 我的脚本完成后,我得到了“测试运行选项:”,但我不知道如何获取可执行文件,它留在哪里?我该如何解决这个错误?
Test run options: --seed 3036
=== WARNING: Watir::Safari was not loadable
path/to/gems/1.9.1/gems/rautomation-0.6.3/lib/rautomation/adapter/autoit/window.rb:20:in `initialize': unknown OLE server: `AutoItX3.Control' (WIN32OLERuntimeError)
HRESULT error code:0x800401f3
Invalid class string
plus loads of random stuff you dont want to read.
.
.
.
完成 ocra 文件时通常是什么样子?
该错误是由以下代码产生的:
require 'watir'
browser = Watir::IE.new
browser.goto("www.amazon.co.uk")
if browser.text.downcase.include?("books")
puts "Woooooohooo"
else
puts "not found"
end
sleep 10
Im using ruby 1.9.2, Watir 2.0.1。 Windows XP 上的 IE 8 但也在 Watir 1.9.2 上尝试过,我遇到了同样的问题。
I get this error but my script does not use safariwatir at all...
My script completes and I get given the "test run options:" but I dont know how to get at the executable file, where is it left? How can I resolve this error?
Test run options: --seed 3036
=== WARNING: Watir::Safari was not loadable
path/to/gems/1.9.1/gems/rautomation-0.6.3/lib/rautomation/adapter/autoit/window.rb:20:in `initialize': unknown OLE server: `AutoItX3.Control' (WIN32OLERuntimeError)
HRESULT error code:0x800401f3
Invalid class string
plus loads of random stuff you dont want to read.
.
.
.
What does it normally look like when it completes an ocra file?
The error is produced by this code:
require 'watir'
browser = Watir::IE.new
browser.goto("www.amazon.co.uk")
if browser.text.downcase.include?("books")
puts "Woooooohooo"
else
puts "not found"
end
sleep 10
Im using ruby 1.9.2, Watir 2.0.1. IE 8 on windows XP but have tried it with Watir 1.9.2 as well and I get the same problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您收到的错误表明问题是 Rautomation(或可能是“autoit”)Gem 的一部分。您是否尝试过更新该 Gem?
The error you are getting gives the problem as being part of the Rautomation (or possibly 'autoit') Gem. Have you tried updating that Gem?
看来 ocra 太急于加载所有内容。默认情况下不应执行此代码,但 ocra 似乎并不关心所有“自动加载”语句,但仍会加载这些文件。如果您无论如何都无法阻止它,请确保 AutoItX3.dll 也与生成的 .exe 文件一起打包,并且与 RAutomation gem 中的路径相对相同。检查路径/to/gems/1.9.1/gems/rautomation-0.6.3/lib/rautomation/adapter/autoit/window.rb:18。但这是警告还是致命错误?
另外,看到它想要加载 SafariWatir,那么我很确定 ocra 会尝试加载每个文件,即使它应该是“自动加载”的。
It seems that ocra is too eager to load everything. This code should not execute by default, but it seems that ocra doesn't care of all the "autoload" statements and will load these files nevertheless. If you can't prevent it anyway, then make sure that also the AutoItX3.dll is packaged with your generated .exe file and is relatively in the same path as it is in RAutomation gem. Check the path/to/gems/1.9.1/gems/rautomation-0.6.3/lib/rautomation/adapter/autoit/window.rb:18. But is it a warning or a fatal error?
Also, seeing that it wants to load SafariWatir, then i'm pretty sure that ocra will try to load every file, even if it should be "autoloaded".