Selenium Webdriver: Click on Download PDF to download the file

Viewed 14

I am using selenium webdriver to automate downloading PDF files. Doing it manually I get the PDF opening in a new tab, the file downloads and the tab closes automatically (No preview window or anything, just opens in a new tab, the file downloads and the tab automatically closes). But when I am using selenium to click on the same "Download PDF" button, nothing is happening. When I check to find the url of the pdf, I only get the following link: javascript:void(0); as the href attribute for the button. Screenshot of the inspect element

How can I accomplish this?

Thank You

0 Answers
Related