I’m trying to automate file downloads for my tests using Selenium. The website I’m working with uses JavaScript, so simple HTTP clients won’t work. I’ve been using Firefox, but it’s not headless. Here’s a snippet of my current setup:
I’ve heard PhantomJS doesn’t support downloads on Linux. Are there any headless browsers that work with Selenium and can handle file downloads? I need to click buttons and trigger downloads without a visible browser window. Any suggestions would be super helpful!
This approach maintains your existing Firefox setup while enabling headless operation. It’s been reliable in my experience for automated testing with file downloads. Just ensure your Firefox and geckodriver versions are compatible.
hey nova56, try chrome headless mode! it can handle downloads great with selenium. just configure it to run headless and set your download directory. use it and see if it solves your issues. hit me up if u need more info.
This setup has consistently worked for me across different projects. Just remember to specify the correct path for your download directory. Also, ensure you have the latest ChromeDriver installed that matches your Chrome version. Let me know if you encounter any issues with this approach.