Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download prompt keeps being displayed #125

Open
mariusz1026 opened this issue Oct 6, 2023 · 1 comment
Open

Download prompt keeps being displayed #125

mariusz1026 opened this issue Oct 6, 2023 · 1 comment

Comments

@mariusz1026
Copy link

mariusz1026 commented Oct 6, 2023

Hello,

No matter what I try, when I run the starter project and click on the download page of the DuckDuckGo page the download prompt opens instead of downloading the file directly.
I've modified the serenity.conf of the starter project as follows

  • added the prefs part
  • added path to chromedriver
  • headless = false

I'm using chromedriver v.117 on chrome v.117.0.5938.14

serenity.conf

serenity {
    take.screenshots = FOR_FAILURES
}

headless.mode = false
webdriver {
  driver = chrome
  capabilities {
    browserName = "chrome"
    acceptInsecureCerts = true
    "goog:chromeOptions" {
      args = ["remote-allow-origins=*","test-type", "no-sandbox", "ignore-certificate-errors", "--window-size=1000,800",
        "incognito", "disable-infobars", "disable-gpu", "disable-default-apps", "disable-popup-blocking",
        "disable-dev-shm-usage", "disable-extensions", "disable-web-security", "disable-translate", "disable-logging"]

      prefs {
        download.default_directory = "C:\\Users\\XXX\\Downloads\\"
        download.directory_upgrade = true
        download.prompt_for_download = false
        safebrowsing.enabled = false
        safebrowsing.disable_download_protection = true
        profile.default_content_settings.popups = 0
      }
    }
  }
}

drivers {
    windows {
        webdriver.chrome.driver = "src/test/resources/chromedriver.exe"
    }
}

The preferences appear in the console :

09:47:05.845 [ForkJoinPool-2-worker-7] INFO n.s.c.w.d.ChromeDriverProvider - Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [test-type, no-sandbox, ignore-certificate-errors, --window-size=1000,800, incognito, disable-infobars, disable-gpu, disable-default-apps, disable-popup-blocking, disable-dev-shm-usage, disable-extensions, disable-web-security, disable-translate, disable-logging, test-type, no-sandbox, ignore-certificate-errors, --window-size=1000,800, incognito, disable-infobars, disable-gpu, disable-default-apps, disable-popup-blocking, disable-dev-shm-usage, disable-extensions, disable-web-security, disable-translate, disable-logging, remote-allow-origins=*], extensions: [], prefs: {download.default_directory: C:\Users\XXX\Downloads, download.directory_upgrade: true, download.prompt_for_download: false, profile.default_content_settings.popups: 0, safebrowsing.disable_download_protection: true, safebrowsing.enabled: false}}}

What am I missing ?

@mariusz1026
Copy link
Author

Adding the args : "safebrowsing-disable-extension-blacklist", "safebrowsing-disable-download-protection"
and the pref : download.extensions_to_open = "appinstaller"
disables the prompt, but the file is opened, which is not what I expect...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant