0

when I use wdio for e2e tests, I got an exception.But my chromedriver is 106.0.1.

[0-1] 2022-10-24T10:58:18.928Z ERROR webdriver: Request failed with status 500 due to session not created: session not created: This version of ChromeDriver only supports Chrome version 104
[0-1] Current browser version is 106.0.5249.119 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

but when I check chromedriver:

chromedriver -v
ChromeDriver 106.0.5249.61 (511755355844955cd3e264779baf0dd38212a4d0-refs/branch-heads/5249@{#569})

I has been tried all those methods: SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81.

But I still got same exception.please help me.

My configureation:

module.exports.config = {
    runner: "local",

    path: "/wd/hub",

    specs: ["./test/specs/*.js"],

    maxInstances: 1,

    capabilities: [
        {
            pageLoadStrategy: "none",

            maxInstances: 1,
            //
            browserName: "chrome",

            "goog:chromeOptions": {
                excludeSwitches: ["enable-automation"],
            },
        },
    ],

    logLevel: "warn",

    bail: 0,

    baseUrl: "http://localhost:3333",

    waitforTimeout: 10000,

    connectionRetryTimeout: 90000,

    connectionRetryCount: 3,

    services: ["chromedriver"],

    framework: "mocha",

    reporters: ["spec"],
}
Riddle
  • 51
  • 1
  • 8
  • It means that the chromedriver used in tests is different from the one you call with -v. Perhaps you need to specify the path to chromedriver somewhere. Keep in mind that test frameworks are able to download the driver just before the test. Please check your config. – Danny Briskin Oct 24 '22 at 16:23
  • As you said. My local chromedriver and the chromedriver in the project are both version 106. However, the error version 104 is still reported. This should be a path problem In fact, I tried to delete all the chrome drivers that could be found, and then reinstall version 106, but still failed to solve this problem. The current solution is to start the local chrome driver first. Then run the test. At this time, it is normal. – Riddle Oct 25 '22 at 03:06

1 Answers1

0

I resolve this question by configure path.

   services: [
            [
                "chromedriver",
                {
                    chromedriverCustomPath: "/usr/local/bin/chromedriver",
                },
            ],
        ],

I solved this problem by configuring the path. But I don't think this is a good method, because it means that any participant who uses this testing function needs to set the chromedriver in this path.

In fact, another project with the same npm version and my other configuration can run normally without configuring the path. This is really strange! This shows that my local chromedriver has no problems and can run directly.

Riddle
  • 51
  • 1
  • 8