我一直在尝试让 HTTPWatch 与 IE9 中的 Watir 自动化配合使用。
我搜索了这些提供代码的网站:
所以我基本上复制了他们的作品并编写了这段代码只是为了测试附加方法:
**require 'rubygems'
require 'win32ole'
require 'watir'
ct = WIN32OLE.new('HttpWatch.Controller')
ie = Watir::IE.new
httpw = ct.Attach(ie.ie)**
我收到以下错误:NoMethodError: undefined method `attach' for WIN32OLE:Class
我的 Ruby 是 1.8.7,Watir 是 2.0.1,HTTPWatch 是 8.1,IE 9。我必须使用团队定义的这些版本。
我在谷歌上搜索了几个小时,我发现 Attach 不是 WIN32OLE 中列出的方法:http://ruby-doc.org/stdlib-1.8.7/
所以我想知道如何使用 HTTPWatch 来记录 IE9 中 Watir 自动化所花费的时间?
最佳答案
我想你想要:
httpw = ct.IE.Attach(ie.ie)
注意:这是基于我在另一个question中看到的内容关于使用 Watir-Webdriver(而不是原来的 Watir)获取 HTTPWatch。我没有HTTPWatch,所以没有测试过。
关于ruby - 当尝试使用 Watir 附加 HTTPWatch 以在 IE9 中工作时,WIN32OLE.attach 是一个未定义的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10238750/