add action to set the path on a file input

Bug #859342 reported by Leo Arias
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
selenium-simple-test
Fix Released
Undecided
Leo Arias

Bug Description

Selenium handles file inputs just as textfields, but sst has a condition that forbids to use textfield_write action on a file input.
As discussed with ~cgoldberg, this function has to be extended to work with file inputs.

Related branches

Leo Arias (elopio)
Changed in selenium-simple-test:
assignee: nobody → Leo Arias (elopio)
status: New → In Progress
Revision history for this message
Corey Goldberg (coreygoldberg) wrote :

merged fix in trunk.

Changed in selenium-simple-test:
status: In Progress → Fix Committed
Revision history for this message
Corey Goldberg (coreygoldberg) wrote :

file_input.py test works on Firefox, but not with Chrome (using Chromedriver).

using:
chromedriver_linux64_14.0.836.0 (latest)
chrome 15.0 (beta)

output:

corey@lenovo:~/sst/selenium-simple-test$ ./sst-run --test file_input -b Chrome
----------------------------------------------------------------------
waiting for django to come up...
django found. continuing...
----------------------------------------------------------------------
test_file_input (sst.runtests.TestFile_Input) ...
Starting Chrome:
Going to... http://localhost:8000/
Waiting for get_element
Writing to textfield 'file_input' with text '/home/corey/sst/selenium-simple-test/src/sst/selftests/file_input.py'
ERROR
Stopping browser

======================================================================
ERROR: test_file_input (sst.runtests.TestFile_Input)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/corey/sst/selenium-simple-test/src/sst/runtests.py", line 249, in test
    exec self.code in context
  File "/home/corey/sst/selenium-simple-test/src/sst/selftests/file_input.py", line 15, in <module>
    textfield_write('file_input', file_path)
  File "/home/corey/sst/selenium-simple-test/src/sst/actions.py", line 384, in textfield_write
    textfield.send_keys(new_text)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 146, in send_keys
    self._execute(Command.SEND_KEYS_TO_ELEMENT, {'value': typing})
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 194, in _execute
    return self._parent.execute(command, params)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 144, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 100, in check_response
    raise exception_class(value)
WebDriverException: Message: '{"sessionId":"b99a9583ce0bb893d1ddff758084e895","status":400,"value":{"message":"The element can not hold multiple files\\nBacktrace:\\n\\tbase::debug::StackTrace::StackTrace() [0x457e9e]\\n\\twebdriver::ElementValueCommand::DragAndDropFilePaths() [0x4465ac]\\n\\twebdriver::ElementValueCommand::ExecutePost() [0x4469cd]\\n\\twebdriver::internal::DispatchHelper() [0x439304]\\n\\twebdriver::Dispatch\\u003C\\u003E() [0x429fe7]\\n\\tanalyze_request [0x436f98]\\n\\tprocess_new_connection [0x438392]\\n\\tworker_thread [0x438631]\\n\\tstart_thread [0x7f4c1a168d8c]\\n\\t0x7f4c1505b04d\\n"}}'

----------------------------------------------------------------------
Ran 1 test in 2.370s

FAILED (errors=1)
----------------------------------------------------------------------

killing django...
corey@lenovo:~/sst/selenium-simple-test$

Changed in selenium-simple-test:
status: Fix Committed → Incomplete
Revision history for this message
Corey Goldberg (coreygoldberg) wrote :

looks like a bug in chromedriver:

http://code.google.com/p/chromium/issues/detail?id=93909

confirmed on #selenium freenode that the next chromedriver release is coming next week.

Leo Arias (elopio)
Changed in selenium-simple-test:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.