Selenium standalone service plugin can not working

Hi
I have not been able to start selenium standalone service through the codeceptjs plugin. I configure it to codecept.conf.js file like

plugins: {
wdio: {
enabled: true,
services: [“selenium-standalone”]
}
},

But when I run my script it shows the following error :

Could not load plugin wdio from module ‘./plugin/wdio’:
Couldn’t initialize service selenium-standalone from wdio plugin config.
It should be available either in ‘@wdio/selenium-standalone-service’ package

Please run

npm install @wdio/selenium-standalone-service --save

Also you should be using local installation of CodeceptJS

Thank you for your quick response.
I installed your command and also installed codeceptjs in local.
But still I am getting the same error.
Is there any other idea?

@nadimsaker I believe that after you turn on the service you also have to pass in the config for that service. Have a look at the doc links below

CodeceptJS Docs

WDIO Service docs

I have already done it but no hope.

How do you run your tests? Do you have CodeceptJs globally installed?

Yes. I have codeceptjs installed both globally and locally.

can you try running with locally installed CodeceptJS runner? It seems like it’s looking at the Global space when you run it with Global CodeceptJS.

Try with,

<your_project>$ ./node_modules/.bin/codeceptjs run --verbose

Thank you for your message.
I used this command got the following error.

Could not load plugin wdio from module ‘./plugin/wdio’:
Couldn’t initialise “@wdio/selenium-standalone-service”.
Error: Cannot find module ‘@wdio/logger’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (C:\Users…AppData\Roaming\npm\node_modules@wdio\selenium-standalone-service\build\launcher.js:8:38)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)

Is there any specific node version or webdriver version that helps to run selenium standalone service automatically?

In my plugins section the wdio config for the plugin looks like this, is it similar to your setup?

        wdio: {
            enabled: true,
            services: ['selenium-standalone'],
            seleniumArgs: {
                version: '3.141.5', // Selenium standalone server version
                drivers: {
                    chrome: {
                        version: '75.0.3770.140', // Chromedriver version
                    },
                    firefox: {
                        version: '0.24.0', // Geckodriver version
                    },
                },
            },
            seleniumInstallArgs: {
                version: '3.141.5',
                baseURL: 'https://selenium-release.storage.googleapis.com',
                drivers: {
                    chrome: {
                        version: '75.0.3770.140',
                        arch: process.arch,
                        baseURL: 'https://chromedriver.storage.googleapis.com',
                    },
                    firefox: {
                        version: '0.24.0',
                        arch: process.arch,
                        baseURL: 'https://github.com/mozilla/geckodriver/releases/download',
                    },
                },
            },
        },

No. This is not similar. I will try with this one and update you. Thank you.

@unreal2frag Thank you. It’s working. Great!:ok_hand:

@unreal2frag I used the same configuration what you have provided above . Am facing the below issue.Could you please help

Error in “Could not request headers from https://selenium-release.storage.googleapis.com/selenium-3.141.59/selenium-server-standalone-3.141.59.jar: 404, continue
without checking for latest version.”.
See more details below:
2022-01-11T07:55:51.475Z ERROR @wdio/selenium-standalone-service: Error: Selenium exited before it could start with code 1
Stdout:
Stderr: Error: Invalid or corrupt jarfile D:\codeceptJS_WDIO\node_modules\selenium-standalone.selenium\selenium-server\3.141.59\selenium-server.jar

you got any resolution???