1 回答

TA貢獻1995條經驗 獲得超2個贊
因為這個元素在60秒內一直沒有展現出來吧,所以報了超時,貼下這個方法的源碼:
#
# Waits until the element is present.
#
# @example
# browser.button(:id => 'foo').wait_until_present
#
# @param [Fixnum] timeout seconds to wait before timing out
#
# @see Watir::Wait
# @see Watir::Element#present?
#
def wait_until_present(timeout = 30)
message = "waiting for #{selector_string} to become present"
Watir::Wait.until(timeout, message) { present? }
end
def until(timeout = 30, message = nil, &block)
end_time = ::Time.now + timeout
until ::Time.now > end_time
result = yield(self)
return result if result
sleep INTERVAL
end
raise TimeoutError, message_for(timeout, message)
end
希望對你有幫助
- 1 回答
- 0 關注
- 123 瀏覽
添加回答
舉報