WebDriverException: unknown error: unable to unzip 'file' when I attached file with russian name

社会主义新天地 提交于 2020-01-14 14:13:24

问题


My selenide test failed with WebDriverException: unknown error: unable to unzip 'file' when it tried to send and attach file with cyrillic name "золотыещенки.png" at Selenoid.

unknown error: unable to unzip 'file'
from unknown error: archive error: (unknown error: could not unzip archive), entry error: (unknown error: invalid data descriptor signature)
  (Session info: chrome=62.0.3202.62)
  (Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.13.9-coreos x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds

Before that it successfully attached all other files with lat names and numbers.

In code it looks like that: $(locator).shouldBe(Condition.visible).scrollTo().sendKeys(file.getAbsolutePath());


回答1:


UPD: this was fixed in all images - all UTF-8 encodings were generated. Should work with latest images.


This is because of missing cyrillic encoding in browser images. A temporary workaround is to build images manually using the following Dockerfile:

FROM selenoid/vnc:chrome_60.0

USER root
RUN locale-gen ru_RU.UTF-8
ENV LANG ru_RU.UTF-8
ENV LANGUAGE ru:en
ENV LC_ALL ru_RU.UTF-8
USER selenium


来源:https://stackoverflow.com/questions/47050742/webdriverexception-unknown-error-unable-to-unzip-file-when-i-attached-file-w

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!