[py] Fix uploading multiple files on remote driver
@@ -534,9 +534,14 @@ class WebElement(BaseWebElement):
# transfer file to another machine only if remote driver is used
# the same behaviour as for java binding
if self.parent._is_remote:
- local_file = self.parent.file_detector.is_local_file(*value)
- if local_file is not None:
- value = self._upload(local_file)
+ local_files = list(map(lambda keys_to_send:
+ self.parent.file_detector.is_local_file(keys_to_send),
+ ''.join(*value).split('\n')))
+ if not None in local_files:
+ remote_files = []
+ for file in local_files:
+ remote_files.append(self._upload(file))
+ value = '\n'.join(remote_files)
self._execute(Command.SEND_KEYS_TO_ELEMENT,
{'text': "".join(keys_to_typing(value)),
