0
  [5040:6784:0906/150930:FATAL:platform_canvas.cc(70)] SK_CRASH              ] 55%
C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill': Timeout::Error (Ti
meout::Error)

        from letsmt_rr_filetype_uploader.rb:43:in `block in <main>'
        from letsmt_rr_filetype_uploader.rb:39:in `each'
        from letsmt_rr_filetype_uploader.rb:39:in `<main>'

这是文件上传进度的 rbuf-fill 超时错误。有没有什么不同的方法可以通过 * NOT * 使用 sleep来避免这种情况?

这是我用于文件上传的脚本:

puts "Tiek veikta atlasīto failu ielāde..."
progress = ProgressBar.create(:title => "Failu ielāde:", :progress_mark => "|", :format => "%t [%B] %p%%", :total => kolekcija.length)
kolekcija.each do |fails|
    @fails = fails[0]
    @b.div(:id, "pageHeader").link(:text, "Corpora").click
    @b.span(:class => "btnText", :text => "Upload corpus").when_present.click
    @b.text_field(:id, "corp_save_field_title").set("TestAuto #{File.basename(@fails)}") # Name / Title
    @b.frame(:id, "uploadManagerFrame").frame(:index, 0).file_field(:id, "FileUploadHTML").set(@fails) # File absolute path
    @b.frame(:id, "uploadManagerFrame").frame(:index, 0).span(:text, "Upload").click
    @b.frame(:id, "uploadManagerFrame").table(:id, "ctrlGetUploadedFiles_gvUploadedFiles").wait_until_present
    @b.frame(:id, "uploadManagerFrame").select_list(:id, "ctrlGetUploadedFiles_gvUploadedFiles_ctl02_ddlChooseType").option(:value, "#{fails[1]}").select
    @b.send_keys :tab
    if @b.frame(:id, "uploadManagerFrame").select_list(:id, "ctrlGetUploadedFiles_gvUploadedFiles_ctl02_ddlChooseLanguage").enabled?
        @b.frame(:id, "uploadManagerFrame").select_list(:id, "ctrlGetUploadedFiles_gvUploadedFiles_ctl02_ddlChooseLanguage").select("English")
        # @b.frame(:id, "uploadManagerFrame").select_list(:id, "ctrlGetUploadedFiles_gvUploadedFiles_ddlChooseLanguage_0").option(:value, "#{@filelang}".select
    end
    @b.send_keys :tab
    @b.span(:class => "btnText", :text => "Save", :index => 1).when_present.click
    @b.frame(:id, "uploadManagerFrame").table(:id, "ctrlGetUploadedFiles_gvUploadedFiles").wait_until_present
    sleep 15
    progress.increment
end
4

1 回答 1

0

我以前见过这个问题,它是由页面上的元素引起的,这些元素通过 ajax 加载而没有响应,因此导致页面以相同的方式超时。最终修复它的唯一方法是将该特定调用包装在 try catch 中。除了尝试捕获之外,请尝试在文件上传后出现的任何确认中将您的睡眠更改为 wait_until_present。如果那里没有,可能值得在幕后添加一个,您可以连接以确认文件已完成上传。

于 2013-09-23T10:39:49.890 回答