web-dev-qa-db-ja.com

ChromeDriverのこのバージョンは、Chrome ChromeDriverでprotractorE2Eテストを実行するバージョン79のエラーでテストされていませんChrome Selenium

これらは私の設定です:

。gitlab-ci.yml

image: node
stages:
    - test
tests:
    stage: test
    before_script:
        # Add Google Chrome to aptitude's (package manager) sources
        - echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee -a /etc/apt/sources.list
        # Fetch Chrome's PGP keys for secure installation
        - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
        # Update aptitude's package sources
        - apt-get -qq update -y
        # Install latest Chrome stable, Xvfb packages
        - apt-get -qq install -y google-chrome-stable xvfb gtk2-engines-pixbuf xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable imagemagick x11-apps default-jre
        # Launch Xvfb
        - Xvfb :0 -ac -screen 0 1024x768x24 &
        # Export display for Chrome
        - export DISPLAY=:99
        # Install AngularJS CLI exclusively
        # Add --unsafe-perm to resolve problems with node-gyp infinite loop on Docker
        - npm install --silent --unsafe-perm -g @angular/[email protected]
    script:
        - npm i --quiet
        - npm run wd-update
        - npm run wd-start &
        - npm run start -- js-files/psh.conf.js
        - npm run wd-shutdown
    only:
        - master
        - merge_request

そして、これはテストのジョブ出力です

     Running with gitlab-runner 12.3.0 (a8a019e0)
     on runner-gitlab-runner-554cdd7fbc-4t8mw zxqBkdf4
     Using Kubernetes namespace: gitlab-managed-apps
     Using Kubernetes executor with image node ...
    Waiting for pod gitlab-managed-apps/runner-zxqbkdf4-project-62-concurrent-15jnmx to be running, status is Pending
    Running on runner-zxqbkdf4-project-62-concurrent-15jnmx via runner-
$ npm i --quiet

> [email protected] install /builds/automation/bender/node_modules/canvas
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
[canvas] Success: "/builds/automation/bender/node_modules/canvas/build/Release/canvas.node" is installed via remote
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","Arch":"any"} (current: {"os":"linux","Arch":"x64"})

added 457 packages from 433 contributors and audited 1390 packages in 15.657s
found 0 vulnerabilities

$ npm run wd-update

> [email protected] wd-update /builds/automation/bender
> webdriver-manager update

[15:03:41] I/file_manager - creating folder /builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/Selenium
[15:03:41] I/config_source - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/Selenium/standalone-response.xml https://Selenium-release.storage.googleapis.com/
[15:03:41] I/config_source - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/Selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/
[15:03:41] I/config_source - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/Selenium/gecko-response.json https://api.github.com/repos/mozilla/geckodriver/releases
[15:03:42] I/downloader - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/Selenium/chromedriver_78.0.3904.105.Zip https://chromedriver.storage.googleapis.com/78.0.3904.70/chromedriver_linux64.Zip
[15:03:42] I/downloader - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/Selenium/selenium-server-standalone-3.141.59.jar https://Selenium-release.storage.googleapis.com/3.141/Selenium-server-standalone-3.141.59.jar
[15:03:42] I/update - chromedriver: unzipping chromedriver_78.0.3904.105.Zip
[15:03:42] I/update - chromedriver: setting permissions to 0755 for /builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/Selenium/chromedriver_78.0.3904.105
[15:03:42] I/downloader - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/Selenium/geckodriver-v0.26.0.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
[15:03:43] I/update - geckodriver: unzipping geckodriver-v0.26.0.tar.gz
[15:03:43] I/update - geckodriver: setting permissions to 0755 for /builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/Selenium/geckodriver-v0.26.0
$ npm run wd-start &
$ npm run start -- js-files/psh.conf.js

> [email protected] wd-start /builds/automation/bender
> webdriver-manager start


> [email protected] prestart /builds/automation/bender
> tsc && ts-cleaner -d js-files

[15:03:44] I/start - Java -Djava.security.egd=file:///dev/./urandom -Dwebdriver.gecko.driver=/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/Selenium/geckodriver-v0.26.0 -Dwebdriver.chrome.driver=/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/Selenium/chromedriver_78.0.3904.105 -jar /builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/Selenium/selenium-server-standalone-3.141.59.jar -port 4444
[15:03:44] I/start - seleniumProcess.pid: 15684
15:03:45.253 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
15:03:45.506 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444
2019-12-17 15:03:45.713:INFO::main: Logging initialized @1029ms to org.seleniumhq.jetty9.util.log.StdErrLog
15:03:46.441 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
15:03:46.780 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444

> [email protected] start /builds/automation/bender
> node src/flake "js-files/psh.conf.js"

[15:03:52] I/launcher - Running 1 instances of WebDriver
[15:03:52] I/hosted - Using the Selenium server at http://localhost:4444/wd/hub
15:03:52.446 INFO [ActiveSessionFactory.apply] - Capabilities are: {
  "browserName": "chrome",
  "chromeOptions": {
    "args": [
      "--headless",
      "--no-sandbox",
      "--window-size=1550,768"
    ]
  },
  "count": 1,
  "maxInstances": 1,
  "shardTestFiles": false
}
15:03:52.449 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.Selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.Selenium.chrome.ChromeDriverService)
Starting ChromeDriver 78.0.3904.70 (edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}) on port 3722
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1576595032.499][SEVERE]: bind() failed: Cannot assign requested address (99)
[1576595033.109][WARNING]: This version of ChromeDriver has not been tested with Chrome version 79.
15:03:53.266 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
15:03:53.323 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 26b7b655c1318cbcde9cfb69871f56ad (org.openqa.Selenium.chrome.ChromeDriverService)
(node:15719) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Started
Jasmine started
2019-12-17T15:03:53.447Z - info: Current test running: 
    Psh site validations Site language should change

(node:15719) UnhandledPromiseRejectionWarning: WebDriverError: invalid session id
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: Host: 'runner-zxqbkdf4-project-62-concurrent-15jnmx', ip: '10.36.0.39', os.name: 'Linux', os.Arch: 'AMD64', os.version: '4.14.138+', Java.version: '1.8.0_232'
Driver info: driver.version: unknown
    at Object.checkLegacyResponse (/builds/automation/bender/node_modules/Selenium-webdriver/lib/error.js:546:15)
    at parseHttpResponse (/builds/automation/bender/node_modules/Selenium-webdriver/lib/http.js:509:13)
    at /builds/automation/bender/node_modules/Selenium-webdriver/lib/http.js:441:30
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:15719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15719) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:15719) UnhandledPromiseRejectionWarning: WebDriverError: invalid session id
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: Host: 'runner-zxqbkdf4-project-62-concurrent-15jnmx', ip: '10.36.0.39', os.name: 'Linux', os.Arch: 'AMD64', os.version: '4.14.138+', Java.version: '1.8.0_232'
Driver info: driver.version: unknown
    at Object.checkLegacyResponse (/builds/automation/bender/node_modules/Selenium-webdriver/lib/error.js:546:15)
    at parseHttpResponse (/builds/automation/bender/node_modules/Selenium-webdriver/lib/http.js:509:13)
    at /builds/automation/bender/node_modules/Selenium-webdriver/lib/http.js:441:30
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:15719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:15719) UnhandledPromiseRejectionWarning: WebDriverError: invalid session id
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: Host: 'runner-zxqbkdf4-project-62-concurrent-15jnmx', ip: '10.36.0.39', os.name: 'Linux', os.Arch: 'AMD64', os.version: '4.14.138+', Java.version: '1.8.0_232'
Driver info: driver.version: unknown
    at Object.checkLegacyResponse (/builds/automation/bender/node_modules/Selenium-webdriver/lib/error.js:546:15)
    at parseHttpResponse (/builds/automation/bender/node_modules/Selenium-webdriver/lib/http.js:509:13)
    at /builds/automation/bender/node_modules/Selenium-webdriver/lib/http.js:441:30
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:15719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)

だから、私が持っているエラーは:UnhandledPromiseRejectionWarning: WebDriverError: invalid session id

  • これについて何か考えはありますか?

私は少なくとも2日間調査しており、関連するものは何も見つかりませんでした。多くのエラーが表示されましたが、このような人はいません。

  • Dockerイメージを使用する必要がありますか?代わりにすべてをその場でインストールしますか?

必要に応じたDockerイメージが見つかりませんでした。

  • 使用しているセレンアドレスは正しいですか?

分度器サイトが推奨するものです:seleniumAddress: ' http:// localhost:4444/wd/hub '

2
Juan Cañete

このエラーメッセージ...

Starting ChromeDriver 78.0.3904.70
.
[1576595033.109][WARNING]: This version of ChromeDriver has not been tested with Chrome version 79.
.
15:03:53.323 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 26b7b655c1318cbcde9cfb69871f56ad (org.openqa.Selenium.chrome.ChromeDriverService)
(node:15719) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

...ChromeDriverが新しいBrowsing Context、つまりChromeを開始/生成できなかったことを意味しますブラウザーセッション。


主な問題は、次のように、使用しているバイナリのバージョン間の非互換性です。

  • chromedriver = 78.0を使用しています
  • chromedriver = 78.0 のリリースノートでは、次のことを明確に述べています。

サポートChromeバージョン78

  • chrome = 79.0を使用しています
  • ChromeDriver v79.0 のリリースノートでは、次のことが明確に述べられています。

サポートChromeバージョン79

したがって、ChromeDriver v78.0Chrome Browser v79.0の間には明らかな不一致があります


解決

確認しておいて:

  • ChromeDriverが現在の ChromeDriver v79. レベルに更新されます。
  • Chromeが現在のChromeバージョン79.0レベルに更新されます。 ( ChromeDriver v79.0リリースノート に従って)
  • クリーンyourプロジェクトワークスペースからyour[〜#〜] ide [〜#〜]およびRebuild必要な依存関係のみを使用してプロジェクトを作成します。

参照

関連する詳細なディスカッションは次の場所にあります。

3
DebanjanB

分度器のnpm実装を使用している場合は、cmdのコマンドの下に次のように入力します。今日chromeによってバージョンが79に変更され、これを行うことで私の問題は解決しました。

webdriver-manager update
1