【问题标题】:How do I use Watir to download a file to a specific location in IE9如何使用 Watir 将文件下载到 IE9 中的特定位置
【发布时间】:2011-09-27 00:32:30
【问题描述】:

在旧版本的 IE 中,有一个弹出窗口。 在 IE9 中,它的底部是一个有趣的栏。 有人尝试过任何可行的方法吗?

【问题讨论】:

    标签: watir browser-automation


    【解决方案1】:

    目前唯一的方法是发送 TAB。

    例如 Watir 和 RAutomation

    ww = Watir::IE.attach(:url, /1.1.1.127/)
    
    #Click on download link
    ww.link(:text, /Download_link/).click
    
    #Click on 'Save As' in the 'funny looking bar on the bottom'
    wrauto = RAutomation::Window.new(:title => ww.title)
    wrauto.send_keys("{TAB}")
    wrauto.send_keys("{TAB}")
    wrauto.send_keys("{DOWN}")
    wrauto.send_keys("{DOWN}")
    wrauto.send_keys("{ENTER}")
    
    #popup window to save
    w = RAutomation::Window.new(:title => /Save As/)
    
    #Direction that you going to save
    w.text_field(:class => "Edit", :index => 0).set path_direction
    
    w.button(:value => "&Save").click
    RAutomation::Window.new(:title => /complete/).button(:value => "Close").click
    

    【讨论】:

      猜你喜欢
      • 2019-06-25
      • 1970-01-01
      • 2018-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-19
      • 2017-05-02
      • 1970-01-01
      相关资源
      最近更新 更多