我正在使用以下配置运行 watir-classic 3.3.0:
- 红宝石 1.9.2p290
- 水经典 3.3.0
- Windows XP 服务包 3
- 即 8
当我尝试在我正在测试的其中一个页面上执行以下脚本时,我收到一个错误
@browser.execute_script "window.confirm = function() { return true; }"
错误:
WIN32OLERuntimeError: (in OLE method `execScript': )
OLE error code:80020101 in <Unknown>
Could not complete the operation due to error 80020101.
HRESULT error code:0x80020009
Exception occurred.
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/page-container.rb:46:in `method_missing'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/page-container.rb:46:in `rescue in execute_script'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/page-container.rb:39:in `execute_script'
from (irb):7
from C:/Ruby192/bin/irb:12:in `<main>'
当我查看浏览器的 Javascript 错误时,我得到以下信息:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET4.0C; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Thu, 3 Jan 2013 16:13:47 UTC
Message: Invalid character
Line: 1
Char: 1
Code: 0
URI: file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js
Message: 'JSON' is undefined
Line: 1
Char: 1
Code: 0
URI: http://iis01/XXX/employees/default.asp
注意:我在 IE Javascript 错误日志中多次收到此信息。
该站点没有加载错误,我不知道为什么 JSON2 无法识别为无效字符。关于如何解决这个问题的任何想法?