Note that there are some explanatory texts on larger screens.

plurals
  1. POSelenium firefox profile opening pdf read when pdfjs.disabled is true & adobe reader is installed
    primarykey
    data
    text
    <p>I am trying to download a pdf file using Selenium web driver with Java. This was working fine the last time I run it about 2 weeks ago, but now every time it clicks on the pdf link it is opening the pdf reader.</p> <p>My firefox profile I create in the test hasn't been changed, it set a download location and sets file to download automatically if they're pdf or csv. The csv files are still working correctly and download to the correct folder.</p> <p>In my code I have pdfjs.disabled set to true and if I open the about:config in the webdriver firefox instance I can see this is set correctly. </p> <p>If I set pdfjs.disabled to true in another firefox instance and manually click a link it works correctly. </p> <p>I'm not sure if firefox has been updated since I last run the test but I have also installed adobe reader on my computer.</p> <p>Please can anyone tell me what could have made it suddenly stop working? </p> <p>This is the the profile I create and the way I call the webdriver. I am using Firefox 21.0 which is the latest version.</p> <pre><code>FirefoxProfile firefoxProfile = new FirefoxProfile(); // Set profile to accept untrusted certificates firefoxProfile.setAcceptUntrustedCertificates(true); //Set profile to not assumet certificate issuer is untrusted firefoxProfile.setAssumeUntrustedCertificateIssuer(false); //Set download location and file types firefoxProfile.setPreference("browser.download.folderList",2); firefoxProfile.setPreference("browser.download.manager.showWhenStarting",false); firefoxProfile.setPreference("browser.download.dir",reportFolder); firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv,application/pdf,application/csv,application/vnd.ms-excel"); // Set to false so popup not displayed when download finished. firefoxProfile.setPreference("browser.download.manager.showAlertOnComplete",false); firefoxProfile.setPreference("browser.download.manager.showAlertOnComplete",false); firefoxProfile.setPreference("browser.download.manager.showWhenStartinge",false); firefoxProfile.setPreference("browser.download.panel.shown",false); firefoxProfile.setPreference("browser.download.useToolkitUI",true); // Set this to true to disable the pdf opening firefoxProfile.setPreference("pdfjs.disabled", true); driver = new FirefoxDriver(firefoxProfile); </code></pre> <p><strong>UPDATE: I removed adobe reader and this started working again. Reader must set something in the profile that I need to disable to get it working with reader. Does anybody have any ideas?</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload