We have a use case where we have save the file generated after a button click. Here are steps:
Open Available Browser
Set Download Directory ${CURDIR}${/}temp
Click Element If Visible
Wait Until Element Is Not Visible #more tasks
We are not able to see the file.
When we check the logs - on Open Available Browser command we are seeing some warning. Have attached the image for the same. Also we see Download as false in the Attempted Combinations table, not sure if that is the problem.
The button click makes an API call which returns the CSV. On local environment the once api call is successful the chrome/other browsers downloads the file as expected in the desired folder.
See point 5. on above list. So default robot templates have “temp” in .gitignore file, so that wont end up in robot.zip unless you remove it from there. But also consider better naming than temp, like for example downloads.
Using operating system library we are creating a directory by name downloads. Below is the code:
OperatingSystem.Create Directory ${CURDIR}${/}downloads
Set Global Variable ${WORKING_DIRECTORY} ${CURDIR}${/}downloads
Using headless=False for Open Available Browser & Setting the Download directory as ${WORKING_DIRECTORY}
Open Available Browser headless=False
Set Download Directory ${WORKING_DIRECTORY}
Waiting for download button to be visible before clicking. (we are not seeing any error here.)
Waiting for loading icon to disappear. (we are not seeing any error here.)
Listing files from the working directory - Logs are showing as empty list. Code(Write Logs is our custom keyword):
${files}= RPA.FileSystem.List files in directory ${WORKING_DIRECTORY}
FOR ${file} IN @{files}
Write Logs ${file}
END
PS: we are also using Maximize Browser Window but we don’t see maximized window as we purposely failed our script for debugging - we see elements in small window.