docker-chromium-xvfb icon indicating copy to clipboard operation
docker-chromium-xvfb copied to clipboard

Send keys option is not working.

Open chatrapathik opened this issue 7 years ago • 1 comments

Hii Adams,

  • We used your image(python2) to run the selenium test cases.
  • image
  • In single file, we wrote two test cases 1: One with send keys, 2: Another one without sending keys.
  • The test case without using send keys is passed and another one with sending keys is failed.
  • Test_case file link
  • This is the final output
test_google_with_send_keys (testing.ExampleTests) ... ERROR
test_google_without_send_keys (testing.ExampleTests) ... ok

======================================================================
ERROR: test_google_with_send_keys (testing.ExampleTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tests/testing.py", line 19, in test_google_with_send_keys
    input_box.send_keys('apple', Keys.RETURN)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 349, in send_keys
    'value': keys_to_typing(value)})
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 493, in _execute
    return self._parent.execute(command, params)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 256, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
WebDriverException: Message: unknown error: an X display is required for keycode conversions, consider using Xvfb
  (Session info: chrome=57.0.2987.98)
  (Driver info: chromedriver=2.28.455506 (18f6627e265f442aeec9b6661a49fe819aeeea1f),platform=Linux 3.13.0-38-generic x86_64)


----------------------------------------------------------------------
Ran 2 tests in 15.282s

FAILED (errors=1)


  • Can you please suggest how can we resolve this issue.Thanks!

chatrapathik avatar Aug 12 '17 12:08 chatrapathik

I got it working by replacing the line chromium --no-sandbox $@ & with chromium --no-sandbox --headless $@ & in the file https://github.com/mark-adams/docker-chromium-xvfb/blob/master/images/base/xvfb-chromium

Hope that helps!

rajanram avatar Oct 06 '17 00:10 rajanram