Comments (4)
That seems strange. Can you include your Dockerfile, your test script, and the docker command that you're using to execute it so that I can help more?
from docker-chromium-xvfb.
I had a same problem, I had solved with follows script in Dockerfile:
export DISPLAY=:1
Xvfb $DISPLAY -ac -screen 0 1280x1024x8 &
sleep 1
the stackoverflow url:
http://stackoverflow.com/questions/25731647/protractor-sendkeys-not-working-an-x-display-is-required-for-keycode-conversion
from docker-chromium-xvfb.
I tested this with the latest images on my sample applications (samples/python2, samples/python3) and everything appears to be working fine.
@rogthedodge, without a copy of your Dockerfile and script, I'm not sure there's much more to do on this one. Please reopen if you still are experiencing the issue.
from docker-chromium-xvfb.
Hii adams,
- When I ran selenium test case using docker i got this error:
======================================================================
ERROR: test_google_title_matches_correct_value (test_google.ExampleTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_google.py", line 13, in test_google_title_matches_correct_value
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 1 test in 14.391s
FAILED (errors=1)
- This is my docker file code:
FROM markadams/chromium-xvfb
RUN apt-get update && apt-get install -y \
python python-pip curl unzip libgconf-2-4
RUN pip install pytest selenium
ENV CHROMEDRIVER_VERSION 2.28
ENV CHROMEDRIVER_SHA256 8f5b0ab727c326a2f7887f08e4f577cb4452a9e5783d1938728946a8557a37bc
RUN curl -SLO "https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip" \
&& echo "$CHROMEDRIVER_SHA256 chromedriver_linux64.zip" | sha256sum -c - \
&& unzip "chromedriver_linux64.zip" -d /usr/local/bin \
&& rm "chromedriver_linux64.zip"
RUN mkdir chatra
ADD . chatra/
WORKDIR chatra/
CMD python -m unittest -v test_google
- This is my test case:
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class ExampleTests(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome('/usr/local/bin/chromedriver')
def test_google_title_matches_correct_value(self):
self.driver.get("http://www.google.com")
input_box = self.driver.find_element_by_id('lst-ib')
input_box.send_keys('apple', Keys.RETURN)
assert "Google" in self.driver.title
self.driver.save_screenshot('google.png')
def tearDown(self):
self.driver.close()
- How can we resolve the above issue? And how can we use chrome driver version (2.29).
from docker-chromium-xvfb.
Related Issues (20)
- Use semantic versioning/tags on the image HOT 4
- Npm doesn't find git
- Chromium outdated, a rebuild would be nice HOT 1
- Python 3 sample fails HOT 1
- After yesterday updates stopped work git in the images
- JS sample doesn't run HOT 1
- Google Chrome doesn't run solo HOT 2
- Can't get selenium to use the wrapper script
- E2E using Protractor HOT 1
- Send keys option is not working. HOT 1
- The basic image can not be installed Twisted
- When taking screenshots via selenium, Images are broken
- Any reasons not to use Alpine HOT 1
- General use for other application
- exec "chrome --version" wait and no response.
- Node 10 support
- Docker hub links in README broken
- What is the purpose of xvfb?
- chrome not reachable
- html format instead of xml
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-chromium-xvfb.