I am in the process of automating a website using WebDriver, but I have encountered unique file download requirements that differ from what is readily available online.
My specific scenario involves a website where I create orders. Upon clicking the 'place order' button, I am redirected to the Print Order page. On this page, a download operation is automatically initiated upon loading, resulting in an immediate file download dialog that blocks the browser interface.
I have explored several solutions, each with its own limitations:
Trying to configure Firefox/Chrome profiles for silent downloads, but unable to proceed due to the need to track download timing.
Considering overriding window.open function to prevent automatic downloads and allow manual intervention, yet hindered by the fact that the download originates from the next page's onload event.
Exploring methods to cancel or intercept the onload function before it executes, but facing challenges implementing this within WebDriver.
Contemplating downloading the print page with wget, modifying the HTML to alter the onload behavior, and injecting back into Selenium, however struggling to replace an entire page effectively.
Unfortunately, I do not have the ability to modify the website's source code as I work in QA without direct development control. Is there any suggestion on how to automate file downloads with precise timing in such a situation?
Thank you.