java - Selenium firefox profile opening pdf read when pdfjs.disabled is true & adobe reader is installed -


i trying download pdf file using selenium web driver java. working fine last time run 2 weeks ago, every time clicks on pdf link opening pdf reader.

my firefox profile create in test hasn't been changed, set download location , sets file download automatically if they're pdf or csv. csv files still working correctly , download correct folder.

in code have pdfjs.disabled set true , if open about:config in webdriver firefox instance can see set correctly.

if set pdfjs.disabled true in firefox instance , manually click link works correctly.

i'm not sure if firefox has been updated since last run test have installed adobe reader on computer.

please can tell me have made stop working?

this the profile create , way call webdriver. using firefox 21.0 latest version.

firefoxprofile firefoxprofile = new firefoxprofile();  // set profile accept untrusted certificates firefoxprofile.setacceptuntrustedcertificates(true);  //set profile not assumet certificate issuer untrusted firefoxprofile.setassumeuntrustedcertificateissuer(false);  //set download location , 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 false 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 true disable pdf opening firefoxprofile.setpreference("pdfjs.disabled", true);  driver = new firefoxdriver(firefoxprofile); 

update: removed adobe reader , started working again. reader must set in profile need disable working reader. have ideas?

try

firefoxprofile.setpreference("plugin.disable_full_page_plugin_for_types", "application/pdf,application/vnd.adobe.xfdf,application/vnd.fdf,application/vnd.adobe.xdp+xml"); 

the trick add pdf mime plugin.disable_full_page_plugin_for_types preference.

this worked firefox 26.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -