按照XvfbRobot指定的用法,我遇到了一些问题。我正试图通过烧瓶进行机器人测试,这似乎正在起作用,但我仍然坚持,“没有浏览器打开,”虽然虚拟显示似乎开始很好。
Dockerfile
FROM alpine:3.4
# Update source repositories
RUN echo "http://dl-4.alpinelinux.org/alpine/v3.4/main" >> /etc/apk/repositories
RUN echo "http://dl-4.alpinelinux.org/alpine/v3.4/community" >> /etc/apk/repositories
ADD . /code
WORKDIR /code
# Install geckodriver:
RUN export BASE_URL=https://github.com/mozilla/geckodriver/releases/download
RUN export VERSION=$(curl -sL https://api.github.com/repos/mozilla/geckodriver/releases/latest | grep tag_name | cut -d '"' -f 4)
RUN curl -sL $BASE_URL/$VERSION/geckodriver-$VERSION-linux64.tar.gz | tar -xz
RUN mv geckodriver /usr/local/bin/geckodriver
RUN chmod a+x /usr/local/bin/geckodriver
# run Xvfb in the background with a display number
RUN Xvfb :10 -ac &
ENV DISPLAY=:10
RUN pip install -r requirements.txt
CMD ["python", "app.py"]
requirements.txt
flask
robotframework
robotframework-selenium2library
robotframework-xvfb
selenium
以下是app repo
的链接版本:
我们非常感谢任何有关正确方向的帮助/指示。