Skip to content

[🐛 Bug]: Text transformation issue with text-transform: capitalize; using Selenium WebDriver with Firefox 127.0.2 #14271

Open
@Usielrivas

Description

@Usielrivas

What happened?

Description:
There is an issue with the text-transform: capitalize; CSS property when using Selenium WebDriver with Firefox 127.0.2. The text transformation does not handle accented characters correctly, resulting in incorrect capitalization.

Steps to Reproduce:

  1. Install Node.js.
  2. Create a new project and install Selenium WebDriver.
    npm init -y
    npm install selenium-webdriver // last version
  3. Download geckodriver 0.34 and place it in a specific directory.
  4. Create the following JavaScript script (selenium_example.js):
const { Builder, By, until } = require('selenium-webdriver');
const firefox = require('selenium-webdriver/firefox');
const path = require('path');

const geckodriverPath = path.join(process.env.HOME, 'gecko/geckodriver');  // Adjust this path

(async function example() {
    let options = new firefox.Options();
    options.setBinary(geckodriverPath);

    let driver = new Builder()
        .forBrowser('firefox')
        .setFirefoxOptions(options)
        .build();

    try {
        const url = 'file:///home/user/test/bug/index.html';

        await driver.get(url);

        await driver.wait(until.elementLocated(By.tagName('h1')), 10000);

        let element = await driver.findElement(By.tagName('h1'));

        let text = await element.getText();

        console.log(`response: ${text}`);
    } finally {
        await driver.quit();
    }
})();
  1. Create the following HTML file (index.html):
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Bug Test</title>
    <style>
        h1 {
            text-transform: capitalize;
        }
    </style>
</head>
<body>
    <h1>Fecha de expiración</h1>
</body>
</html>
  1. Run the script:
    node selenium_example.js

Expected Behavior:
The output should be:

response: Fecha De Expiración

Actual Behavior:
The output is:

response: Fecha De ExpiraciÓN

Additional Information:

  • Operating System: Fedora 40
  • Node.js: v20.12.2
  • Selenium WebDriver: 4.22.0
  • geckodriver: 0.34.0 (c44f0d09630a 2024-01-02 15:36 +0000)
  • Firefox: 127.0.2

This issue started occurring after updating to Firefox 127.0.2. It appears that the text-transform: capitalize; CSS property does not handle accented characters correctly.

Console Output:
No errors in the console.


How can we reproduce the issue?

already described

Relevant log output

already described

Operating System

Fedora 40

Selenium version

4.22.0

What are the browser(s) and version(s) where you see this issue?

Firefox: 127.0.2

What are the browser driver(s) and version(s) where you see this issue?

geckodriver: 0.34.0 (c44f0d09630a 2024-01-02 15:36 +0000)

Are you using Selenium Grid?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-atomsJavaScript chunks generated by Google closureI-defectSomething is not working as intendedR-help wantedIssues looking for contributions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions