UnhandledPromiseRejectionWarning: NoSuchSessionError

UnhandledPromiseRejectionWarning: NoSuchSessionError



App.js


const webdriver = require('selenium-webdriver'),
By = webdriver.By,
until = webdriver.until;

var driver = new webdriver.Builder().forBrowser('chrome').build();
driver.get('www.google.com');

driver.sleep(10000);
driver.quit();



When I try to run my app.js the following error appears:



$ node app.js



DevTools listening on
ws://127.0.0.1:12525/devtools/browser/8885c592-ea61-41cd-ade7-222a355ea668
(node:14556) UnhandledPromiseRejectionWarning: NoSuchSessionError: no
such session (Driver info: chromedriver=2.9.248315,platform=Windows
NT 6.3 x86_64)
at Object.checkLegacyResponse (C:UsersAseelDesktopelcccnode_modulesselenium-webdriverlib
error.js:585:15)
at parseHttpResponse (C:UsersAseelDesktopelcccnode_modulesselenium-webdriverlibhttp.js:5
33:13)
at Executor.execute (C:UsersAseelDesktopelcccnode_modulesselenium-webdriverlibhttp.js:46
8:26)
at
at process._tickCallback (internal/process/next_tick.js:188:7) (node:14556) UnhandledPromiseRejectionWarning: Unhandled promise
rejection. This error originated ei ther 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:14556)
[DEP0018] DeprecationWarning: Unhandled promise rejections are
deprecated. In the futur e, promise rejections that are not handled
will terminate the Node.js process with a non-zero exit c ode.






change line 6 to driver.get('www.google.com').catch(err => console.log(err))

– Josh
Sep 12 '18 at 20:27


driver.get('www.google.com').catch(err => console.log(err))




0



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)