seleniumhq-community / docker-seleniarm

Multi-Arch (arm64/armhf/amd64) Docker images for the Selenium Grid Server
https://hub.docker.com/u/seleniarm
Other
249 stars 26 forks source link

[🐛 Bug]: Unicode file upload not supported in chromium standalone #61

Closed kitchra closed 2 months ago

kitchra commented 8 months ago

What happened?

Running a Selenium script which uploads a file with a unicode filename fails when using the seleniarm chromium image.

Sample script:

import os
from selenium import webdriver
from selenium.webdriver.common.by import By

options = webdriver.ChromeOptions()
driver = webdriver.Remote(command_executor="http://localhost:4444", options=options)

driver.get("https://cgi-lib.berkeley.edu/ex/fup.html")
drop_target = driver.find_element(By.XPATH, "//input[@name='upfile']")
drop_target.send_keys(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'űűőőóö.txt'))
value = drop_target.get_attribute("value")
assert "??????.txt" not in value, f"value was {value}"

The same script works in the following scenarios:

The only time it does not work is when using the chromium image. Although the keys get sent as űűőőóö.txt, the value in the element becomes '??????.txt` rather than preserve the unicode.

Command used to start Selenium Grid with Docker (or Kubernetes)

docker run --rm -it -p 4444:4444 -p 5900:5900 -p 7900:7900 --shm-size 2g seleniarm/standalone-chromium:latest

Relevant log output

Traceback (most recent call last):
  line 13, in <module>
    assert "??????.txt" not in value, f"value was {value}"
           ^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: value was C:\fakepath\??????.txt

Operating System

macOS Sonoma

Docker Selenium version (tag or chart version)

120.0

diemol commented 8 months ago

These images are based on debian and most likely there is a language pack missing to support this. The plan is to move them to ubuntu and then it will most likely start working.

VietND96 commented 2 months ago

ARM64 images is merged to selenium registry and using Ubuntu based (https://www.selenium.dev/blog/2024/multi-arch-images-via-docker-selenium/). Can you please check latest images and confirm?