Downloading file and saving it to the desired location in Selenium Webdriver

0 votes

I want to download a file (like an image, pdf, jar and so on) by clicking on any link or button then, click on the save button if present and then save the file to the desired location.

How can we implement this using Java in Selenium WebDriver?

May 8, 2018 in Selenium by Atul
• 10,240 points
1,699 views

1 answer to this question.

0 votes

When you are setting up the Firefox profile, you need to add a call to set the property: browser.helperApps.neverAsk.saveToDisk to a comma-separated list of MIME types to always download it. Use the below code to set:

firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv");
answered May 8, 2018 by Meci Matt
• 9,460 points

Related Questions In Selenium

0 votes
1 answer

How do i change the location where my file gets downloaded in Selenium Webdriver and firefox driver?

There are a couple of errors there. ...READ MORE

answered Apr 13, 2018 in Selenium by nsv999
• 5,500 points
6,190 views
0 votes
1 answer

What is Xpath and what are the types of it in Selenium Webdriver?

Hi Piyush, XPath is defined as XML path. It is ...READ MORE

answered May 9, 2019 in Selenium by Pratibha
• 3,690 points
5,371 views
+1 vote
1 answer
0 votes
0 answers

In Selenium, how to give a name to a file when it is downloading?

I'm working with a Selenium script where I'm ...READ MORE

Jul 15, 2019 in Selenium by Vaishnavi
• 1,180 points
3,295 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,673 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,142 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,221 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,874 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP