Search code examples
robotframework

Downloading files with Browser library


I have been trying to download .xlsx or .pdf files with Robot framework while using Browser Library. Every time browser downloads something the file name is just a bunch of random values.

example: be3a051f-c533-4sac-b252-742d415b5e48

I have tried this keyword https://marketsquare.github.io/robotframework-browser/Browser.html#Download and just a basic "Click" on the file name but every time the file just gets saved as a example above, and the file doesn't include anything useful. examples of the "code" used to click the file on browser

Click  text=${file_name}
Download   text=${file_name}

Is there something else i am missing which needs to be set to directly get the excel.xlsx file to download to a desired place? I got "acceptDownloads" and "downloadsPath" set.

Thanks in advance


Solution

  • ${dl_promise}    Promise To Wait For Download    saveAs=D:\\Preview.zip
    Click    //*[text()='Export CSV']
    ${file_obj}=    Wait For  ${dl_promise}