【发布时间】:2019-02-15 22:01:54
【问题描述】:
我需要延长 @page.run_asset 上的等待时间,因为完成该过程可能需要超过 30 秒的时间。所以我找到了 Watir.default_time 并将其添加到我的代码中。当我运行测试时,它仍然失败并显示与以前相同的错误:
失败/错误:@page.run_asset Selenium::WebDriver::Error::ScriptTimeOutError: 脚本超时:30 秒内未收到结果
it 'expects table action to succeed' do
Watir.default_timeout = 180
@page.debug_asset(table_name)
@page.select_sample(sample)
@page.run_asset
expect(@page.return_to_input_element.present?).to be true
end
我尝试实现以下代码并显示相同的错误。
it 'expects table action to succeed' do
wait = Selenium::WebDriver::Wait.new(timeout: 150)
@page.debug_asset(table_name)
@page.run_asset
field_displayed = wait.until {
@asset_debugger_page.return_to_input_element.present? }
expect(@page.return_to_input_element.present?).to be true
end
我环顾四周,似乎找不到一个好的答案。任何帮助将不胜感激。
谢谢
【问题讨论】: