Home > OS >  Getting below error whenever I try to run Cypress Suite
Getting below error whenever I try to run Cypress Suite

Time:07-30

Error: Cannot find module 'cypress-xpath' from 'D:\Automation Code\Cypress\cypress-ui-automation\cypress\support' at D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve\node_modules\resolve\lib\async.js:46:17 at process (D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve\node_modules\resolve\lib\async.js:173:43) at ondir (D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve\node_modules\resolve\lib\async.js:188:17)

CodePudding user response:

It looks like you have missed the install of cypress-xpath.

If you are installing with npm:

npm install -D cypress-xpath

or if you are installing with yarn:

yarn add cypress-xpath --dev

You clearly already have the the require statement in \cypress\support since that is the first path in the error stack.

CodePudding user response:

Assuming that the cypress-xpath plugin is already installed, Under cypress/support/e2e.js you have to add this:

require('cypress-xpath');
  • Related