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.

Options not applied to Chrome in Selenium 4

See original GitHub issue

💥 Regression Report

It seems that options are not applied properly to Chrome driver anymore in Selenium 4.

Last working Selenium version

Worked up to version: 3.141.0

Stopped working in version: 4.0.0.b1

To Reproduce

Detailed steps to reproduce the behavior:

>>> from selenium import webdriver
>>> options = webdriver.ChromeOptions()
>>> options.add_argument('--headless')
>>> options.add_argument('--window-size=1800,800')
>>> driver = webdriver.Chrome(options=options)

Expected behavior

I would expect Chrome to start in headless mode with the right window size, but it seems that the chosen options are ignored.

Perhaps the options need to be specified differently in 4.0 but I have not been able to find any documentation on that.

Environment

OS: Ubuntu 20.04 LTS Browser: Chrome Browser version: 89.0.4389.82 (Official Build) (64-bit) Browser Driver version: ChromeDriver 89.0.4389.23 Language Bindings version: Python 4.0.0.b1

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
AutomatedTestercommented, Mar 15, 2021

@GergelyKalmar We hope to have b2 released in the next couple of days.

0reactions
GergelyKalmarcommented, Mar 15, 2021

That would be wonderful! Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading from Selenium 3.11.0 to 4.0.0 can't find Chrome ...
In Selenium 4, DesiredCapabilities have been replaced by Options. To use the Driver class, QAs have to create an Options class, set test ......
Read more >
Chrome Options & Desired Capabilities in Selenium Webdriver
The Chrome options class is generally used in conjunction with Desired Capabilities for customizing Chrome driver sessions. It helps you perform ...
Read more >
Browser Options - Selenium
As of Selenium 4, you must use the browser options classes. For remote driver sessions, a browser options instance is required as it ......
Read more >
Set Chrome Options for Selenium Tests. | BrowserStack Docs
Set Chrome Options. Customize and configure ChromeDriver sessions for Selenium tests on BrowserStack Automate. A ChromeDriver session i.e. a test running on ...
Read more >
Chrome WebDriver Options - Tutorialspoint
add_experimental_option(n, val) − It is used to append an experimental option which is passed to the Chrome browser. add_extension(ext) − It is used...
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