Skip to content

Commit

Permalink
Fix send_keys with variable argument by removing variable expansion. (#…
Browse files Browse the repository at this point in the history
…8840)



Co-authored-by: David Burns <[email protected]>
  • Loading branch information
sufyanAbbasi and AutomatedTester authored Nov 10, 2020
1 parent 745d01f commit 85ae06e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions py/selenium/webdriver/remote/webelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,10 @@ def send_keys(self, *value):
# transfer file to another machine only if remote driver is used
# the same behaviour as for java binding
if self.parent._is_remote:
local_files = list(map(lambda keys_to_send:
self.parent.file_detector.is_local_file(keys_to_send),
''.join(*value).split('\n')))

This comment has been minimized.

Copy link
@pythobot

pythobot Apr 10, 2021

This line was broken since this commit. the asterisk should not be removed. because it produces a tuple object:

value = '/tmp/6556456-45645645-4545645.jpg'
send_keys(value)
["('/tmp/6556456-45645645-4545645.jpg',)"]

hence, making the os.path.isfile() in is_local_file() unabled to find the file locally.

It should be:

''.join(str(*value)).split('\n')

This comment has been minimized.

Copy link
@pythobot
if None not in local_files:
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))
Expand Down

0 comments on commit 85ae06e

Please sign in to comment.