Skip to content

[🐛 Bug]: I would like to download file in excel with selenium edge web driver in specific custom folder in java selenium using options.setExperimentalOption #14927

@saikatdas98

Description

@saikatdas98

What happened?

I have created a folder. If I try to download an Excel file, the file will download there, but when I run my test in the Edge browser, it downloads to the default download location.

How can we reproduce the issue?

HashMap<String, Object> edgePrefs = new HashMap<>(); 
edgePrefs.put("download.default_directory", System.getProperty("user.dir") + "\Download-Files"); edgePrefs.put("profile.default_content_settings.popups", 0); edgePrefs.put("profile.default_content_setting_values.automatic_downloads", 1);  
EdgeOptions EdgeOptions options = new EdgeOptions();

options.setExperimentalOption("prefs", edgePrefs);
I have tried this way, but setExperimentalOption shows an error: The method setExperimentalOption(String, HashMap<String, Object>) is undefined for the type EdgeOptions

Relevant log output

N/A

Operating System

Windows 11

Selenium version

Java 4.27.0

What are the browser(s) and version(s) where you see this issue?

Edge

What are the browser driver(s) and version(s) where you see this issue?

Edge

Are you using Selenium Grid?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-questionApplied to questions. Issues should be closed and send the user to community resources.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions