我正在使用Watir自动化一个充满框架的内部工具。我能够操纵所有各种元素,所以我知道我正确地识别帧,但是每当我尝试对任何这些元素使用Wait语句时它都会失败。追溯错误消息,它总是在core_ext / time / computation中命中activesupport gem,看起来它无法获取持续时间值,它被设置为false,然后操作失败,因为它期望一个Float。这是一个错误吗?
使用Ruby 1.8.7和Watir 1.6.7
我的代码是:
require 'rubygems'
require 'watir/testcase'
require 'main_setup'
require 'win32ole'
require 'common'
class Smoketest < Watir::TestCase
include CommonCode
def test_AddEdit_Endpoint
Watir::Wait.until { @b.link(:id,"lbShowEndpointForm").exists? }
end
end
错误如下:
test_basic_smoke(Smoketest):
TypeError: can't convert false into Float
C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.9/lib/active_support/core_ext/time/calculations.rb:278:in `plus_without_duration'
C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.9/lib/active_support/core_ext/time/calculations.rb:278:in `+'
C:/Ruby187/lib/ruby/gems/1.8/gems/commonwatir-1.6.7/lib/watir/wait.rb:15:in `until'
C:/qa/trunk/CCAdmin/Automation/CCAdmin/lib/smoketest.rb:27:in `test_basic_smoke'
答案 0 :(得分:0)
那么,哪一行是C:/qa/trunk/CCAdmin/Automation/CCAdmin/lib/smoketest.rb:27?
答案 1 :(得分:0)
我认为命令的正确用法是wait_until,除非它从Watir 1.6.5更改,http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Waiter.html