I am writing an automated UI test solution based on Selenium WebDriver. I need a browser-independent method that can achieve file downloads.
My method, which relies on the System.Net.WebClient class, can successfully download files from a site if there is an attribute (such as href or src) from which to infer the file location.
However, I am having issues when the element that would normally hold the reference has no pointer to a file. Instead, this element has a CSS class that is tied to a Javascript click event. When the element is clicked, Javascript triggers a window.open action on a dynamically-created link.
Any ideas on how can I successfully capture that file reference from my C# code?