We do not recommend testing PDF download functionality with Sauce. There are two main issues that come up when performing such a test using Selenium Webdriver:
- Clicking on the link to the PDF file may automatically open a PDF plugin to view the file, which Selenium can't access.
- Download dialogs are native browser UI elements, so they they are not supported by Selenium.
You could try to work around these issues by changing your browser configuration to download PDF files automatically, as described in this article from Elemental Selenium. However, users don't have access to the filesystem on the virtual machines where the browser is running. Essentially, file validation isn't something that can be done with a remote Selenium grid such as Sauce Labs.
To test file download functionality of the site, you should consider downloading it locally. First, get the URL of the PDF link using Selenium. Then download the file using wget, cURL, or your favorite HTTP library to your local drive. Finally, you can validate the file by checking the MD5 values of the downloaded files.
This blog post has more information regarding file downloads with Selenium: