selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🐛 Bug]: JSON encoding warning from Ruby Selenium::WebDriver::Remote::Http::Common

Open theDogOfPavlov opened this issue 1 month ago â€ĸ 3 comments

Description

What I saw:

Due to a recent change in the JSON module, which is a dependency, when a non UTF-8 value reaches Selenium::WebDriver::Remote::Http::Common then a warning is thrown:

warning: JSON.generate: UTF-8 string passed as BINARY, this will raise an encoding error in json 3.0

What I would expect:

Values are encoded as UTF-8 before being passed on to the JSON.generate call, or otherwise if they fail encoding, an error is raised.

Reproducible Code

Selenium::WebDriver::Driver.execute_script( 'return navigator.userAgent;'.force_encoding( Encoding::BINARY ) )

â„šī¸ Last known working version: It is an issue with the JSON dependency, which has changed.

theDogOfPavlov avatar Dec 08 '25 09:12 theDogOfPavlov

@theDogOfPavlov, thank you for creating this issue. We will troubleshoot it as soon as we can.

Selenium Triage Team: remember to follow the Triage Guide

selenium-ci avatar Dec 08 '25 09:12 selenium-ci

âš ī¸ You reported using Selenium version 4.38, but the latest release is 4.39.

Please verify that this issue still occurs with the latest version. If it no longer applies, you can close this issue or update your comment.

This issue will be marked "awaiting answer" and may be closed automatically if no response is received.

github-actions[bot] avatar Dec 08 '25 09:12 github-actions[bot]

Still affects 4.39

theDogOfPavlov avatar Dec 08 '25 09:12 theDogOfPavlov