Docker镜像selenium/standalone-firefox:3.4.0-chromium
是否包含Firefox和Chrome驱动程序?
现在我有这个Dockerfile来构建一个selenium服务器:
FROM selenium/standalone-firefox:3.4.0-chromium
USER root
ENV NODE_ENV test
RUN mkdir -p /usr/local/cdt-tests/csv-data
COPY ./csv-data /usr/local/cdt-tests/csv-data
USER seluser
它适用于Firefox,但我收到与Chrome相关的错误:
[20:14:36] I/testLogger - [chrome #11] PID: 15
[chrome #11] Specs: /usr/local/cdt-tests/test/e2e/by-roles/itso/home-page/home-page-spec.js
[chrome #11]
[chrome #11] (node:15) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[chrome #11] selenium host: cdt-selenium.cdt-net
[chrome #11] cdt server host: cdt-server.cdt-net
[chrome #11] cdt server port: 3040
[chrome #11] [20:14:35] I/hosted - Using the selenium server at http://cdt-selenium.cdt-net:4444/wd/hub
[chrome #11]
[chrome #11] /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:546
[chrome #11] throw new ctor(message);
[chrome #11] ^
[chrome #11] WebDriverError: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
[chrome #11] at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:546:15)
[chrome #11] at parseHttpResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
[chrome #11] at doSend.then.response (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:441:30)
[chrome #11] at <anonymous>
[chrome #11] at process._tickCallback (internal/process/next_tick.js:188:7)
[chrome #11] From: Task: WebDriver.createSession()
[chrome #11] at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
[chrome #11] at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:761:15)
[chrome #11] at createDriver (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:170:33)
[chrome #11] at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:626:16)
[chrome #11] at Hosted.getNewDriver (/usr/local/lib/node_modules/protractor/built/driverProviders/driverProvider.js:53:33)
[chrome #11] at Runner.createBrowser (/usr/local/lib/node_modules/protractor/built/runner.js:195:43)
[chrome #11] at q.then.then (/usr/local/lib/node_modules/protractor/built/runner.js:339:29)
[chrome #11] at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54)
[chrome #11] at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:863:30)
[chrome #11] at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:796:13)
所以我唯一的猜测是Docker图像实际上并不是为了包含Google Chrome Selenium驱动程序而设计的?那为什么图像名称中有“铬”?困惑。
答案 0 :(得分:1)
没有。在这种情况下,“铬”是版本指示符。看看https://hub.docker.com/r/selenium/standalone-firefox/tags/,你会看到铋,锑,ast,铜。该项目显然使用元素作为版本或构建标识符。