question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose ChromeOptions

See original GitHub issue

Is your feature request related to a problem? Please describe. I’ve found myself in a position where I need to set some chrome options before execution. Specifically the “Download PDF files instead of automatically opening them in Chrome” option.

Describe the solution you’d like It would be really nice if this could be configurable prior to running the test.

Describe alternatives you’ve considered Right now, I navigate to the screen for the test by doing url chrome://settings/content/pdfDocuments?search=pdf and then prompting to turn it on before continuing. While this works okay, it’s not fully automated.

Additional context If Selenium exposes more ChromeOptions I would like to see those available as well to optimize specific tests in the future. Mostly just focused on the pdf download option now.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
fischgeekcommented, Oct 7, 2020

Found it! Thanks again!

This SO article helped as well.

let startMode = 
            let options = Chrome.ChromeOptions()
            options.AddUserProfilePreference("download.prompt_for_download", false)
            options.AddUserProfilePreference("plugins.plugins_disabled", "Chrome PDF Viewer")
            options.AddUserProfilePreference("plugins.always_open_pdf_externally", true)
            let start = canopy.types.BrowserStartMode.ChromeWithOptions options
            start
        
start startMode
0reactions
fischgeekcommented, Oct 7, 2020

Haha! yes, thank you. The documentation page has been a bookmark bar button for the past week. I’m just trying to comb through it to find out how to set this up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebDriver for Chrome - Capabilities & ChromeOptions
Most Chrome-specific capabilities are exposed through the ChromeOptions object. In some languages, this is implemented by the ChromeOptions class.
Read more >
Class ChromeOptions
Class to manage options specific to ChromeDriver . Example usage: ChromeOptions options = new ChromeOptions() options.
Read more >
ChromeOptions causes reference error using Selenium ...
I am trying to use the ChromeDriver driver for Selenium to run some tests using Chrome, but I'm getting a reference error when...
Read more >
Capabilities & ChromeOptions - ChromeDriver
Most Chrome-specific capabilities are exposed through the ChromeOptions object. In some languages, this is implemented by the ChromeOptions class.
Read more >
ChromeOptions - javadoc.io
Sets an experimental option. Useful for new ChromeDriver options not yet exposed through the ChromeOptions API. Parameters: name - Name of the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found