-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
File upload broken #9292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We need 4.0, but the recent releases always had some issues. See SeleniumHQ/selenium#9292
Please can we have a reproducible test case. I’ve added tests for upload for the last beta so know it does upload files and does not error.
…On Mar 17, 2021, 5:34 AM +0000, Michal Čihař ***@***.***>, wrote:
🐛 Bug Report
A clear and concise description of what the bug is.
File upload with Chrome and Selenium 4.0.0b2 fails with:
File "/home/nijel/weblate/weblate/.venv/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 768, in _upload
raise e
File "/home/nijel/weblate/weblate/.venv/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 759, in _upload
return self._execute(Command.UPLOAD_FILE, {'file': content})['value']
File "/home/nijel/weblate/weblate/.venv/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 693, in _execute
return self._parent.execute(command, params)
File "/home/nijel/weblate/weblate/.venv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 369, in execute
self.error_handler.check_response(response)
File "/home/nijel/weblate/weblate/.venv/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 236, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown command: unknown command: session/ef65ec6962b7f875385bacdb072ee837/se/file
Stacktrace:
#0 0x562d9d555069 <unknown>
#1 0x562d9d4f72d3 <unknown>
#2 0x562d9d281946 <unknown>
#3 0x562d9d2d575a <unknown>
#4 0x562d9d2d5574 <unknown>
#5 0x562d9d257d75 <unknown>
#6 0x562d9d258fa3 <unknown>
#7 0x562d9d522bc4 <unknown>
#8 0x562d9d5315ea <unknown>
#9 0x562d9d5312de <unknown>
#10 0x562d9d53598a <unknown>
#11 0x562d9d531e8b <unknown>
#12 0x562d9d517ff0 <unknown>
#13 0x562d9d257bdf <unknown>
#14 0x7f58aaa96d0a __libc_start_main
#15 0x562d9d25672a _start
There are already some related issues like #7666 or #8735, but they really don't give any hints how to address this.
It is broken since #8588, removing the se/ prefix from the Command.UPLOAD_FILE fixes the behavior.
To Reproduce
Detailed steps to reproduce the behavior:
element.send_keys(element._upload("screenshot.png"))
Expected behavior
The upload would work.
Test script or set of commands reproducing this issue
Reproducible in https://github.com/WeblateOrg/weblate CI: https://github.com/WeblateOrg/weblate/runs/2124766327?check_suite_focus=true
Environment
OS: Linux
Browser: Chrome
Browser version:89.0.4389.82
Browser Driver version: ChromeDriver 89.0.4389.82
Language Bindings version: Python 4.0.0b2
Selenium Grid version (if applicable):
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Also, are you using Grid or running those tests locally? |
Running locally. I can reproduce this both on my system and on GitHub Actions. |
A code snippet would be helpful, could you please post it here? |
This is what fails with 4.0.0b2 and worked in 4.0.0a6.post2 (I could not use versions in between due to other issues): Here the webdriver is constructed: It might be that we're doing something wrong, but it worked just fine for several years and broke now. |
You appear to be calling an internal method here on that line, why are you not just calling |
Honestly, I don't recall why we're doing that, it might be a relict from the past when we used SauceLabs and did not run the browser locally. |
It doesn't seem to be needed now. See SeleniumHQ/selenium#9292
Thanks for pointing me into that direction, removing usage of internal method seems to work. Feel free to close this if it behaves as intended. |
glad you got it sorted! |
🐛 Bug Report
A clear and concise description of what the bug is.
File upload with Chrome and Selenium 4.0.0b2 fails with:
There are already some related issues like #7666 or #8735, but they really don't give any hints how to address this.
It is broken since #8588, removing the
se/
prefix from theCommand.UPLOAD_FILE
fixes the behavior.To Reproduce
Detailed steps to reproduce the behavior:
Expected behavior
The upload would work.
Test script or set of commands reproducing this issue
Reproducible in https://github.com/WeblateOrg/weblate CI: https://github.com/WeblateOrg/weblate/runs/2124766327?check_suite_focus=true
Environment
OS: Linux
Browser: Chrome
Browser version:89.0.4389.82
Browser Driver version: ChromeDriver 89.0.4389.82
Language Bindings version: Python 4.0.0b2
Selenium Grid version (if applicable):
The text was updated successfully, but these errors were encountered: