Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Can't connect to WebDriver error when running tests on through CLI

Open
#2,859 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, nodejs
Domain
cli, testing-qa

Research direction

Start by reproducing the failure with npx codeceptjs run --verbose from the project root using the supplied configuration. Inspect the WebDriver and selenium-standalone setup around the reported chromedriver path and the before all hook. Done means CLI test execution no longer fails with the reported ETXTBSY error.

Written by the indexing model from the issue text.

Description

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 --verbose mode 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:

  1. 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

Dominant language
JavaScript
Stars
4.2k
Forks
756
Avg merge
2d 9h
Merged PRs (30d)
16

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from codeceptjs/CodeceptJS

All issues in codeceptjs/CodeceptJS

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.