[🚀 Feature]: Add support for chrome-headless-shell to Selenium Manager

オープン
#16,276 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
領域
tooling

調査の方向性

まず Selenium Manager にある Chrome の既存の検出とダウンロード処理を読み、次にブラウザーオプションが Selenium の実装にどのように渡されるかを追跡します。スタンドアロンの chrome-headless-shell のサポートと、両方のバイナリを取得する方法を比較します。選択したアプローチが、サポート対象のすべてのプラットフォームで一致するバイナリを確実にダウンロードして解決し、必要に応じて Selenium 側の処理にも対応できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

B-manager I-enhancement
Background

Previously it was decided in #13600 (2024-03) that chrome-headless-shell shall not be supported by Selenium Manager, due to it being part of the main chrome binary.

There's nothing separate to download, it's part of the Chrome installation, and there's not a good reason to support this independently.

This is no longer true, as --headless=old is no longer supported as of Chrome 132 (2025-01-14):

We're happy to announce that the old Headless mode will be removed in Chrome 132.

And:

If you are using old Headless functionality you should now migrate to chrome-headless-shell (to retain old Headless functionality) or to the new Headless mode, which continues to be provided by the Chrome binary.

While new headless mode is suitable for full CI testing, the old headless mode is significantly faster, making it a much better fit for iterative TDD testing when browser interactions are under test.

Feature Request

Selenium Manager should either:

  • fetch both binaries when chrome is specified

or

  • provide support for chrome-headless-shell as a standalone browser option

In either case, it seems likely that Selenium implementations will also need to adjust to handle the separate binaries (perhaps by noticing --headless=old and switching binaries?), but that seems like a secondary task dependent on SM supporting autodownloads of both binaries.

Have you considered any alternatives or workarounds?

The current workaround I've come up with is to install the chrome-headless-shell binary myself, and specify that as the binary to use when running Selenium. eg.

browser_options = Selenium::WebDriver::Chrome::Options.new
browser_options.binary = '/some/path/to/binary/chrome-headless-shell'

# Using Capybara + Selenium, but the point applies regardless of testing engine
Capybara::Selenium::Driver.new(app, browser: :chrome_headless_shell, options: browser_options)

I've put together a rickety emulation of SM's autodownload behaviour that attempts to match the installed Chrome version, but makes no attempt to be cross-platform nor support most browsers.

This is obviously not as robust as Selenium Manager handling it properly, but it does work for now and avoids a hardcoded local path and (some) manual updates.

主要言語
Java
スター
34.6k
フォーク
8.7k
平均マージ
1日 16時間
マージ済み PR(30日)
107

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SeleniumHQ/selenium のほかの issue

SeleniumHQ/selenium の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。