Samuel Facchinello
2014-04-01 14:56:25 UTC
Hi, I'm Samuel of Brazil.
following this tutorial:
http://elementalselenium.com/tips/2-download-a-file
Implemented in Java with selenium version 2.41. Worked perfectly with the
image, but with txt (and xml from another site) does not work, always opens
the download window.
Any tips?
Thank you.
CODE:
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.
setAcceptUntrustedCertificates(true);
firefoxProfile.setPreference("browser.download.folderList",2);//browser
dir
firefoxProfile.setPreference("browser.download.dir",tempDir);
firefoxProfile.setPreference(
"browser.helperApps.neverAsk.saveToDisk",
"application/xml,text/plain,text/xml,image/jpeg");
driver = new FirefoxDriver(firefoxProfile);
driver.get("http://the-internet.herokuapp.com/download");
new WebDriverWait(driver, 10).until(ExpectedConditions.
presenceOfElementLocated(By.className("example")));
driver.get("http://the-internet.herokuapp.com/download/dummy.txt
");
driver.get("
Loading Image...
");
driver.quit();
following this tutorial:
http://elementalselenium.com/tips/2-download-a-file
Implemented in Java with selenium version 2.41. Worked perfectly with the
image, but with txt (and xml from another site) does not work, always opens
the download window.
Any tips?
Thank you.
CODE:
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.
setAcceptUntrustedCertificates(true);
firefoxProfile.setPreference("browser.download.folderList",2);//browser
dir
firefoxProfile.setPreference("browser.download.dir",tempDir);
firefoxProfile.setPreference(
"browser.helperApps.neverAsk.saveToDisk",
"application/xml,text/plain,text/xml,image/jpeg");
driver = new FirefoxDriver(firefoxProfile);
driver.get("http://the-internet.herokuapp.com/download");
new WebDriverWait(driver, 10).until(ExpectedConditions.
presenceOfElementLocated(By.className("example")));
driver.get("http://the-internet.herokuapp.com/download/dummy.txt
");
driver.get("
Loading Image...
driver.quit();
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to selenium-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/be55e2db-065c-469f-a7dc-6d27c714c86c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to selenium-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/be55e2db-065c-469f-a7dc-6d27c714c86c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.