0

I have installed this docker images from a host with selenium hub and Chrome-node-debug. Till today I was able to run my Protractor scripts but all of sudden today it started giving me the following issue. Not sure why the versions are not matching with the driver in the host. I even tried to update my selenium hub and chromedriver to 4.1.0 but still the error is same and not changing. where is this chrome picking up from not sure. Can someone help me as I am stuck with this and not able to fix it.

error in console.

[22:39:30] W/driverProviders - Using driver provider directConnect, but also found extra driver provider parameter(s): seleniumAddress
[22:39:30] I/launcher - Running 1 instances of WebDriver
[22:39:30] I/direct - Using ChromeDriver directly...

DevTools listening on ws://127.0.0.1:63120/devtools/browser/0571b2db-fa5a-4184-915b-ff0cc9a18948
[1118/223932.776:ERROR:url_util.cc(414)] Invalid pattern javascript://
[22:39:33] E/launcher - session not created: This version of ChromeDriver only supports Chrome version 94
Current browser version is 96.0.4664.45 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
  (Driver info: chromedriver=94.0.4606.61 (418b78f5838ed0b1c69bb4e51ea0252171854915-refs/branch-heads/4606@{#1204}),platform=Windows NT 10.0.19043 x86_64)
[22:39:33] E/launcher - SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 94
Current browser version is 96.0.4664.45 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
  (Driver info: chromedriver=94.0.4606.61 (418b78f5838ed0b1c69bb4e51ea0252171854915-refs/branch-heads/4606@{#1204}),platform=Windows NT 10.0.19043 x86_64)
    at Object.checkLegacyResponse (C:\Dev\Node\node-v14.18.1-win-x64\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:546:15)
    at parseHttpResponse (C:\Dev\Node\node-v14.18.1-win-x64\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:509:13)  
    at C:\Dev\Node\node-v14.18.1-win-x64\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:441:30
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
From: Task: WebDriver.createSession()
    at Function.createSession (C:\Dev\Node\node-v14.18.1-win-x64\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
    at Function.createSession (C:\Dev\Node\node-v14.18.1-win-x64\node_modules\protractor\node_modules\selenium-webdriver\chrome.js:761:15)
    at Direct.getNewDriver (C:\Dev\Node\node-v14.18.1-win-x64\node_modules\protractor\built\driverProviders\direct.js:77:33)
    at Runner.createBrowser (C:\Dev\Node\node-v14.18.1-win-x64\node_modules\protractor\built\runner.js:195:43)
    at C:\Dev\Node\node-v14.18.1-win-x64\node_modules\protractor\built\runner.js:339:29
    at _fulfilled (C:\Dev\Node\node-v14.18.1-win-x64\node_modules\protractor\node_modules\q\q.js:834:54)
    at C:\Dev\Node\node-v14.18.1-win-x64\node_modules\protractor\node_modules\q\q.js:863:30
    at Promise.promise.promiseDispatch (C:\Dev\Node\node-v14.18.1-win-x64\node_modules\protractor\node_modules\q\q.js:796:13)
    at C:\Dev\Node\node-v14.18.1-win-x64\node_modules\protractor\node_modules\q\q.js:556:49
    at runSingle (C:\Dev\Node\node-v14.18.1-win-x64\node_modules\protractor\node_modules\q\q.js:137:13)
[22:39:33] E/launcher - Process exited with error code 199

Conf.js file

let domainName = util.domainName;
exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub', //for local testing
  directConnect: true, // Set to true for local testing, or provide a link to a running selenium grid.
  // specs: ['e2e/**/*-test.js'],
  specs: ['e2e/**/mailbox-test.js'],
  capabilities: {
    browserName: 'chrome',
    acceptInsecureCerts: true,
    'goog:chromeOptions': {
      w3c: false,
      args: [
        '--no-sandbox',
        '--headless',
        '--disable-gpu',
        '--window-size=1200,1200',
        '--allow-insecure-localhost',
        '--allow-running-insecure-content',
        '--ignore_ssl',
        '--user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36',
      ],
    },
  }

enter image description here

Vin
  • 165
  • 2
  • 12

1 Answers1

2

This error message...

W/driverProviders - Using driver provider directConnect, but also found extra driver provider parameter(s): seleniumAddress

...implies that the are two options available and both the options are enabled where as you need to choose one among:

  • Using driver provider directConnect
  • Using driver provider parameter through seleniumAddress

Additionally, it seems the of v79.0 is forced into effect as:

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36'

This usecase

From your settings both the modes are enabled but the directConnect configuration is effective which is having ChromeDriver v94


Solution

As a solution, you can adopt any of the following approaches:

  • Update the directConnect driver provider to use the matching ChromeDriver of your Chrome version.
  • Update the seleniumAddress driver provider to use the matching ChromeDriverof your Chrome version.
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Sorry for the late reply. I have realized that and after turning that to false it worked. The main reason it was set to true before and my scripts were working at that moment when my docker selenium grid was not correctly configured and my scripts seems to be running with directConnect. But later I reinstalled the selenium grid using different procedure and then its working fine on the grid. Anyhow thanks for your response too – Vin Nov 30 '21 at 02:38
  • @DebanjanB : how to find the relevant user agent? In my case, it is Linux machine with Chrome version 94.0.4606.54 – sathiya Nov 30 '21 at 16:15
  • @DebanjanB : i am using Protractor for automation scripts which are running in gitlab pipeline. can you elaborate on the suggestions? – sathiya Nov 30 '21 at 16:30