CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

module seleniumwebdriver not found.

Open ecampii opened this issue 8 years ago • 10 comments

reinstalling codeceptjs with the following.

sudo npm install codeceptjs webdriverio selenium-webdriver -g /usr/local/bin/codeceptjs -> /usr/local/lib/node_modules/codeceptjs/bin/codecept.js /usr/local/bin/wdio -> /usr/local/lib/node_modules/webdriverio/bin/wdio

What do you get instead?

Could not load helper SeleniumWebdriver from module './helper/SeleniumWebdriver': Cannot find module 'co'

ecampii avatar Mar 05 '18 00:03 ecampii

I'm pretty sure this is because selenium-webdriver is no longer supported in codeceptjs. However don't worry you can use the Protractor Helper (with the angular: false option for non-angular apps), and the api is the same :)

It is mentioned in the docs.

So to install the dependencies run:

npm install codeceptjs -g
npm install protractor --save-dev
npm install webdriverio --save-dev

I'm a little bit sceptical of doing installing multiple npm packages in one command, so it might be safer to install it one at a time.

reubenmiller avatar Mar 05 '18 17:03 reubenmiller

thanks, i used those but im still getting

Could not load helper SeleniumWebdriver from module './helper/SeleniumWebdriver': Cannot find module 'co'

ecampii avatar Mar 05 '18 18:03 ecampii

Can you try deleting the node_modules/codeceptjs folder and try to install it again.

Also what node version are you using?

reubenmiller avatar Mar 05 '18 18:03 reubenmiller

node -v v8.9.0

thanks ill try to create a fresh install..

ecampii avatar Mar 05 '18 18:03 ecampii

same warning.

Could not load helper SeleniumWebdriver from module './helper/SeleniumWebdriver': Cannot find module 'co'

ecampii avatar Mar 05 '18 18:03 ecampii

Ok more troubleshooting:

  1. What is your dev setup? (I've run the command on os x 10.12.6 running node 8.9.3)
  2. Did you delete the whole node_modules folder?
  3. Try installing not using the global npm option. i.e. npm install codeceptjs. Though you have to be within an npm project (i.e. having run npm init already)

reubenmiller avatar Mar 05 '18 19:03 reubenmiller

  1. When is this error message occuring, during the npm install? Or are you running a command after the installation?

reubenmiller avatar Mar 05 '18 19:03 reubenmiller

after running codeceptjs run --steps

ecampii avatar Mar 06 '18 02:03 ecampii

I created a new init folder and it worked.

ecampii avatar Mar 06 '18 02:03 ecampii

I’m guessing that was because you previously had the deprecated selenium webdriverio helper defined in your configuration and not protractor.

But I’m glad it now works for you :)

reubenmiller avatar Mar 06 '18 05:03 reubenmiller