Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1K
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda