Step 1: My app creates a PDF report in a new window generated by Cognos Viewer. All of the reports take 1-30 seconds to complete, and I don't know how to wait for a "complete" message.
Step 2: When the report is completed, a "download" icon appears. I would like to save the PDF report to a file with a unique name (right now, all reports in a category can be downloaded with a generic name, but the reports need to be run with different parameters. I cannot seem to reach the download icon with driver.findElement(By.id("download")).click();
The Page Source in the browser looks like it's mostly Javascript. When I use the Inspector I can see the HTML (where I found the id=download). It's not clear to me how the PDF and HTML interact.
I'm running Selenium Webdriver with Java/Eclipse on Windows on Firefox.
Any help is appreciated. Thanks in advance.