Robot Framework Download File

前端 未结 3 1965
借酒劲吻你
借酒劲吻你 2020-12-29 11:56

I use Robot Framework.

On my HTML page I have a simple button. When you click on it, it downloads a pdf file.

How can I check with Robot Framework if the fil

3条回答
  •  庸人自扰
    2020-12-29 12:11

    ${home_dir}         Get Environment Variable    HOME
    ${download_dir}     Join Path   ${home_dir}     Downloads
    ${result}    Run Keyword And Return Status  File Should Exist   
    ${download_dir}/filename.pdf
    

    To check further on the file ${content} Get File ${download_dir}/filename.pdf ${count_file} Get Line Count ${content}

    Above can be used for basic assertion For more keywords please check the link http://robotframework.org/robotframework/latest/libraries/OperatingSystem.html

提交回复
热议问题