【发布时间】:2017-10-24 16:50:48
【问题描述】:
作为我测试的一部分,我想在浏览器上加载 pdf 文件时自动从浏览器下载它。有人可以指导我如何实现这一点。以下是我尝试过的方式。我尝试单击下载按钮,但它对我不起作用。以下是浏览器上出现的截图。
*** Test Cases ***
Download and deploy content package
${output}= Run keyword job history
Log to console ${output}
# create unique folder
${now} Get Time epoch
${download directory} Join Path ${OUTPUT DIR} downloads_${now}
Create Directory ${download directory}
${chrome options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
${prefs} Create Dictionary prompt_for_download=false download.default_directory=${download directory}
Call Method ${chrome options} add_experimental_option prefs ${prefs}
Create Webdriver Chrome chrome_options=${chrome options}
Goto ${output}
Sleep 5
【问题讨论】:
标签: pdf robotframework selenium2library