Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1K
Views
WebDriverError: unknown error: net::ERR_CONNECTION_REFUSED

Hi tried to run selenium test in docker.

const { Builder, By} = require("selenium-webdriver");
const chrome = require('selenium-webdriver/chrome');
const assert = require('assert')

async function addCadastreTest() {
    const options = new chrome.Options()
    options.setAcceptInsecureCerts(true)
    let driver = await new Builder()
        .forBrowser("chrome")
        .usingServer('http://localhost:4444/wd/hub')
        .setChromeOptions(options)
        .build();
    
    await driver.get("http://localhost:3000/");
    await driver.findElement(By.id("fit")).click()

    assert(await driver.switchTo().alert().getText() == "Quel est le nom de votre commune ?")
    {
      const alert = await driver.switchTo().alert()
      await alert.sendKeys("Lons le Saunier")
      await alert.accept()

    }
    await driver.quit();
}
addCadastreTest();

This is the stacktrace of the error :

mapbox\node_modules\selenium-webdriver\lib\error.js:522
    let err = new ctor(data.message)
              ^

WebDriverError: unknown error: net::ERR_CONNECTION_REFUSED
  (Session info: chrome=102.0.5005.61)
    at Object.throwDecodedError mapbox\node_modules\selenium-webdriver\lib\error.js:522:15)
    at parseHttpResponse (mapbox\node_modules\selenium-webdriver\lib\http.js:549:13)
    at Executor.execute (mapbox\node_modules\selenium-webdriver\lib\http.js:475:28)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.execute (mapbox\node_modules\selenium-webdriver\lib\webdriver.js:735:17)
    at async addCadastreTest (mapbox\test\addCadastre.spec.js:14:5) {
  remoteStacktrace:

I'm stuck because i tried to run this test in java with selenium in docker and it work but in JavaScript i get this weird error connection refused. If someone have a thought to solve my problem thank.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!