第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如下是執(zhí)行ruby腳本報(bào)錯(cuò)TimeoutError,請(qǐng)問該怎么改?

如下是執(zhí)行ruby腳本報(bào)錯(cuò)TimeoutError,請(qǐng)問該怎么改?

婷婷同學(xué)_ 2023-03-16 17:13:03
腳本:require "watir"browser = Watir::Browser.new :iebrowser.bring_to_frontbrowser.maximizebrowser.goto urlbrowser.span(:text=>"cas").wait_until_presentbrowser.span(:text=>"cas").when_present.click錯(cuò)誤: C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-classic/wait.rb:29:in `until': timed out after 60 seconds (Watir::Wait::TimeoutError)from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.6.0/lib/watir-classic/element_extensions.rb:63:in `wait_until_present'from nwmtest.rb:26:in `<main>'
查看完整描述

1 回答

?
拉風(fēng)的咖菲貓

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ì)你有幫助


查看完整回答
反對(duì) 回復(fù) 2023-03-18
  • 1 回答
  • 0 關(guān)注
  • 132 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)