1 回答

TA貢獻(xiàn)1995條經(jīng)驗(yàn) 獲得超2個(gè)贊
因?yàn)檫@個(gè)元素在60秒內(nèi)一直沒有展現(xiàn)出來吧,所以報(bào)了超時(shí),貼下這個(gè)方法的源碼:
#
# 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
希望對(duì)你有幫助
- 1 回答
- 0 關(guān)注
- 132 瀏覽
添加回答
舉報(bào)