Ocra“Watir::Safari 无法加载”

发布于 2024-11-28 20:15:27 字数 812 浏览 1 评论 0原文

我收到此错误,但我的脚本根本不使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

尘曦 2024-12-05 20:15:27

您收到的错误表明问题是 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?

池予 2024-12-05 20:15:27

看来 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".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文