I have to upload large file (more than 1GB
size) using remote selenium server
but get urllib.error.URLError <urlopen error [Errno 32] Broken pipe>
error.
Here is a python
code including remote
driver setup which looks like:
from selenium.webdriver import ChromeOptions, Remote
options = ChromeOptions()
options.add_argument("--start-maximized")
remote = Remote(command_executor="http://localhost:9515",
desired_capabilities=options.to_capabilities())
remote.find_element_by_css_selector('input[name="file"]'
).send_keys('path/to/file.iso'))
Here is a traceback sample error I have:
ERROR: File "/home/user/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 475, in send_keys
ERROR: value = self._upload(local_file)
ERROR: File "/home/user/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 692, in _upload
ERROR: return self._execute(Command.UPLOAD_FILE, {'file': content})['value']
ERROR: File "/home/user/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 628, in _execute
ERROR: return self._parent.execute(command, params)
ERROR: File "/home/user/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
ERROR: response = self.command_executor.execute(driver_command, params)
ERROR: File "/home/user/.local/lib/python3.6/site-packages/selenium/webdriver/remote/remote_connection.py", line 472, in execute
ERROR: resp = opener.open(request, timeout=self._timeout)
ERROR: File "/usr/lib/python3.6/urllib/request.py", line 526, in open
ERROR: response = self._open(req, data)
ERROR: File "/usr/lib/python3.6/urllib/request.py", line 544, in _open
ERROR: '_open', req)
ERROR: File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
ERROR: result = func(*args)
ERROR: File "/usr/lib/python3.6/urllib/request.py", line 1346, in http_open
ERROR: return self.do_open(http.client.HTTPConnection, req)
ERROR: File "/usr/lib/python3.6/urllib/request.py", line 1320, in do_open
ERROR: raise URLError(err)
ERROR: urllib.error.URLError: <urlopen error [Errno 32] Broken pipe>
Please note that files below 70mb
size are uploading successfully but when I try to upload larger files it fails.
I use python 3.6
, selenium 3.12.0
, chromedriver 2.42
and Chrome 71
. I did try with different selenium, chromedriver and Chrome versions but got the same error.
I suspect that there are some chromeoptions that I can use to fix this, but haven't found yet what exactly can help me.
I would appreciate your help!