[🐛 Bug]: Bindings change the user's options when Selenium Manager supplies a browser

Abierto
#18,428 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@Liz-Lian ya está trabajando en esto.

Desde el 2/12/2026.

  • #18431 de @Liz-Lian — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp, java, javascript, python, ruby
Área
backend, devtools

Línea de trabajo

Read the listed Ruby, Python, Java, .NET, and JavaScript driver entry points to compare where each binding mutates options and constructs session capabilities. Start with the Ruby reproduction, then trace the equivalent option and capability flows in each binding. Done means all bindings preserve the user's options, omit the browser version only from that session's capabilities when a binary is set, and log that omission at debug level.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

C-dotnet C-java C-nodejs C-py C-rb I-defect
Description

When Selenium Manager supplies a browser, every binding writes the browser path into the user's options object and clears its browser version. The browser version has to be left out of the session request, because the binary now decides which browser runs. But changing the user's object means the change outlives that one session.

Reusing one options object for several sessions is common. Capybara passes the same options to every new browser it starts after a quit or reset, test fixtures share options across tests, and retry code tries again with the same object. After the first session:

  • The user's version request is gone. Later sessions send Selenium Manager --browser-path <cached browser> with no --browser-version. The browser is the same, but the logs now look as if the user had pinned a browser path. Nothing records that the path came from Selenium, or which version the user actually asked for. This made a failing Capybara run on GitHub Actions hard to diagnose: its first attempt asked Selenium Manager for 157, and the retries only showed a path to a cached browser.
  • Changing the version afterwards fails. If the user sets a different browser_version on the reused object, Selenium Manager gets both the new version and the old path, and errors out. See the logs below.

Expected:

  • Leave the user's options unchanged. Apply the browser path, and leave out the browser version, only in the capabilities sent for that session.
  • Log at debug when the browser version is left out because a browser binary is set, so each session's log shows what was requested and why it wasn't sent.

Where each binding changes the options:

Reproducible Code
require 'selenium-webdriver'

options = Selenium::WebDriver::Options.chrome(browser_version: '157', args: ['--headless'])
Selenium::WebDriver.for(:chrome, options: options).quit

p options.browser_version # => nil
p options.binary          # => ".../.cache/selenium/chrome/mac-arm64/157.0.8103.78/.../Google Chrome for Testing"

options.browser_version = '156'
Selenium::WebDriver.for(:chrome, options: options) # => NoSuchDriverError: Unable to obtain chromedriver
Debugging Logs
ERROR Selenium [:selenium_manager] The browser at /Users/<user>/.cache/selenium/chrome/mac-arm64/157.0.8103.78/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing has version 157.0.8103.78 but chrome 156 was requested; remove --browser-path to allow a browser download
ERROR Selenium [:driver_finder] Exception occurred: Unsuccessful command executed: [".../selenium-manager", "--browser", "chrome", "--browser-version", "156", "--browser-path", "/Users/<user>/.cache/selenium/chrome/mac-arm64/157.0.8103.78/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing", "--language-binding", "ruby", "--output", "json"] - Code 65
Lenguaje dominante
Java
Estrellas
34.6k
Forks
8.7k
Merge medio
1 d 16 h
PR fusionados (30 d)
107

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de SeleniumHQ/selenium

Todos los issues de SeleniumHQ/selenium

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.