Use Case
In our site, clicking a button triggers the print preview modal with a custom file to print. Because it's a separate file (generated/fetched on-the-fly), we can't just use regular mechanisms to print the webpage.
Using Chrome's flag for --kiosk-printing will automatically confirm the print modal (and it's defaulting to "Save as PDF" since there are no other printers in the container). However, this is downloaded to the directory specified by the savefile.default_directory preference (by default - more information below).
Request
Since we are using managed downloads, Selenium sets download.default_directory for us (I think this is the file). Could we also set savefile.default_directory to the same value please?
Additional Information
--kiosk-printing will not prompt to choose a directory when saving a PDF
- I checked the value via
cat /tmp/.org.chromium.Chromium.7wzSS0/Default/Preferences | jq '.savefile' in the Selenium Node (Chrome) container
- I got the directory via chrome://profile-internals
- There is no
savefile key (jq shows null) when Chrome is first launched
- Attempting to print (and thus save to PDF) will set it by default to
/home/seluser/Downloads (which doesn't exist)
- If the
savefile.default_directory value doesn't exist, then no file will be saved
- This is kind of a bug I guess?
- If the user right-clicks and chooses "Save As" on a webpage or image, this will prompt for a directory, and update the value of
savefile.default_directory if the page is saved (but not if the user cancels the dialogue box)
- This is only when using VNC, we can't interact with the OS from Selenium
Use Case
In our site, clicking a button triggers the print preview modal with a custom file to print. Because it's a separate file (generated/fetched on-the-fly), we can't just use regular mechanisms to print the webpage.
Using Chrome's flag for
--kiosk-printingwill automatically confirm the print modal (and it's defaulting to "Save as PDF" since there are no other printers in the container). However, this is downloaded to the directory specified by thesavefile.default_directorypreference (by default - more information below).Request
Since we are using managed downloads, Selenium sets
download.default_directoryfor us (I think this is the file). Could we also setsavefile.default_directoryto the same value please?Additional Information
--kiosk-printingwill not prompt to choose a directory when saving a PDFcat /tmp/.org.chromium.Chromium.7wzSS0/Default/Preferences | jq '.savefile'in the Selenium Node (Chrome) containersavefilekey (jqshowsnull) when Chrome is first launched/home/seluser/Downloads(which doesn't exist)savefile.default_directoryvalue doesn't exist, then no file will be savedsavefile.default_directoryif the page is saved (but not if the user cancels the dialogue box)