Quality Testing

Quality is delighting customers

IQ: How to save the file in specific location using Selenium WebDriver?

Save the file (notepad / word / excel) in specific location.

Please share the sample code.

Views: 117

Reply to This

Replies to This Discussion

You won't be able to access the save dialog box. That's controlled by the OS. The only thing you're really going to be able to do is set the default download location for the browser and allow it to automatically download the files. Then check the file in Java.

You should check this answer from this previous SO question. Basically when setting up your Firefox profile you add a call to set the property browser.helperApps.neverAsk.saveToDisk to a comma separated list of MIME types to always download:

firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv");


See this Mozilla KB FAQ article on About:configs.

UPDATE It looks like this may now be possible see this answer in another question

Thanks Jensi!

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2018   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service