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

Replace deprecated headless! option #63

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

chrisroos
Copy link
Contributor

@chrisroos chrisroos commented Oct 9, 2023

This Selenium blog post from 29 Jan 2023 explains that the headless! convenience method is being deprecated. There are now 2 headless modes in Chromium so we should use the arguments to browser options to define the mode we want.

The deprecation message reads:

2023-10-09 11:12:07 WARN Selenium [:headless] [DEPRECATION]
Options#headless! is deprecated. Use
Options#add_argument('--headless=new') instead.

Although it says to use --headless=new, I've chosen to switch to --headless in this commit as this retains the existing behaviour of headless!. You can verify this in the diff of the commit that removes the deprecated headless! method.

This Selenium blog post from 29 Jan 2023[1] explains that the
`headless!` convenience method is being deprecated. There are now 2
headless modes in Chromium so we should use the arguments to browser
options to define the mode we want.

The deprecation message reads:

> 2023-10-09 11:12:07 WARN Selenium [:headless] [DEPRECATION]
> `Options#headless!` is deprecated. Use
> `Options#add_argument('--headless=new')` instead.

Although it says to use `--headless=new`, I've chosen to switch to
`--headless` in this commit as this retains the existing behaviour of
`headless!`. You can verify this in the diff of the commit that removes
the deprecated `headless!` method[2].

[1]: https://www.selenium.dev/blog/2023/headless-is-going-away/
[2]: SeleniumHQ/selenium@0fa6c3f
@chrisroos chrisroos marked this pull request as ready for review October 9, 2023 10:21
Copy link
Contributor

@robinjam robinjam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@chrisroos chrisroos merged commit 5841530 into main Oct 9, 2023
10 checks passed
@chrisroos chrisroos deleted the replace-deprecated-headless-option branch October 9, 2023 10:26
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

Successfully merging this pull request may close these issues.

2 participants