Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error from Selenium: UnhandledPromiseRejectionWarning: Error: ECONNREFUSED connect ECONNREFUSED

I am brand new to node.js and Selenium so please bear with me if I don't give all the details needed right away.

This is my very simple test which I want to run in FF (I found a lot of questions here like this but they refer to Chrome):

const webdriver = require('selenium-webdriver');

const builder = new webdriver.Builder();
builder.forBrowser('firefox');
const driver = builder.build();

driver.get('https://google.com');

driver.quit();

This is the error I keep getting:

(node:3534) UnhandledPromiseRejectionWarning: Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:62412 at ClientRequest. (/Users/name/training/learningnodejs/node_modules/selenium-webdriver/http/index.js:244:15) at ClientRequest.emit (events.js:160:13) at Socket.socketErrorListener (_http_client.js:389:9) at Socket.emit (events.js:160:13) at emitErrorNT (internal/streams/destroy.js:64:8) at process._tickCallback (internal/process/next_tick.js:152:19) (node:3534) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:3534) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Selenium version: 5.6.0

like image 567
TesterMcTesterson Avatar asked Feb 14 '18 16:02

TesterMcTesterson


1 Answers

Had the same issue. Installing of previous version of selenium-webdriver help for me.

npm install [email protected]
like image 197
Vitalii Fedoryshyn Avatar answered Oct 15 '22 20:10

Vitalii Fedoryshyn