Can't connect to WebDriver error when running tests on through CLI
What are you trying to achieve?
Try to run tests using CLI.
NOTE: It worth to mention that with my current configuration, I am able to run tests when debugging with my IDE (Visual Studio Code). But same config and test files fails when running npx codeceptjs run on CLI.
What do you get instead?
Error message on CLI.
Provide console output if related. Use
--verbosemode for more details. CodeceptJS v3.0.5 Using test root "/mnt/c/projects/codeceptjs-demo" Helpers: WebDriver Plugins: screenshotOnFail, retryFailedStep, tryTo, wdio
test1 -- Error in "uncompressDownloadedFile:readStream.pipe". See more details below: ETXTBSY: text file is busy, open '/mnt/c/projects/codeceptjs-demo/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64-chromedriver' Error in "uncompressDownloadedFile:readStream.pipe". See more details below: ETXTBSY: text file is busy, open '/mnt/c/projects/codeceptjs-demo/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64-chromedriver' [1] Error | Error: ETXTBSY: text file is busy, open '/mnt/c/projects/codeceptjs-demo/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64-chromedriver' ✖ "before all" hook: codeceptjs.beforeSuite for "test 1 @t1" in 1495ms [1] Error | Error: ETXTBSY: text file is busy, open '/mnt/c/projects/codeceptjs-demo/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64-chromedriver' Error: ETXTBSY: text file is busy, open '/mnt/c/projects/codeceptjs-demo/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64-chromedriver' S test 2 @t2
-- FAILURES:
- test1 "before all" hook: codeceptjs.beforeSuite for "test 1 @t1": ETXTBSY: text file is busy, open '/mnt/c/projects/codeceptjs-demo/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64-chromedriver'
FAIL | 0 passed, 1 failed, 1 skipped // 1s › Stopped SeleniumStandaloneLauncher
# paste output here
I'm running command `npx codeceptjs run --verbose` under project root path level.
Provide test source code if related
// paste test
Details
- CodeceptJS version:
- NodeJS Version:
- Operating System:
- puppeteer || webdriverio || protractor || testcafe version (if related)
- Configuration file:
# paste config here
const { setHeadlessWhen } = require('@codeceptjs/configure');
// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);
exports.config = {
tests: './*_test.js',
output: './output',
helpers: {
WebDriver: {
url: 'localhost',
browser: 'chrome',
restart: false,
windowSize: '1920x1680',
desiredCapabilities: {
chromeOptions: {
args: [
"--headless",
"--disable-gpu",
"--no-sandbox"
]
}
}
}
},
include: {
I: './steps_file.js'
},
bootstrap: null,
mocha: {},
name: 'codeceptjs-demo',
plugins: {
pauseOnFail: {},
retryFailedStep: {
enabled: true
},
tryTo: {
enabled: true
},
screenshotOnFail: {
enabled: true
},
wdio: {
enabled: true,
services: ['selenium-standalone']
}
}
}
Thank you