我想知道以下是否可能:
@wait = Selenium::WebDriver::Wait.new timeout: 10
# ...do stuff...
# Stuff gets really slow here. Better increase the timeout.
def janky_method()
old_timeout = @wait.timeout
@wait.timeout += 50
e = @wait.until { @selenium.find_element :css, 'div#page-loads-rock' }
@wait.timeout = old_timeout
e
end
到目前为止,我看到的唯一解决方案是启动一个新Wait
驱动程序。我可以更改现有的超时时间吗?