Reputation: 75
I am using 'selenium-webdriver' npm package to simulate an endpoint user - I click on buttons, select drop-downs and checkboxes.
I come across an image that will help me download a PDF file.
I generally use this basic Selenium documentation: https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/
2nd reference I use is: Selenium-javascript-docs
Most of the Selenium question-answers are in the java language, so those don't help me as I'm using the javascript package.
I do know it has to do with the chrome options, or a chrome-specific field, but the document is just lacking. I came across the chrome-driver doc, but it is not javascript-friendly.
Other than disabling the automatic-download feature, I am also interested in changing the download directory to a custom location.
Any help or reference/guide/documentation source is greatly appreciated. Thank you in advance and thank you for reading.
Upvotes: 0
Views: 185
Reputation: 9944
You can use setDownloadPath to modify the path where the file will be downloaded.
Other than that, I don't think there's an option to prevent the automatic download
Upvotes: 1