OSX 10.13
4.0.0-alpha.1
Firefox developer edition
62.0b15
If cookie is not exists, I should get null just like official document said.
https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/webdriver_exports_Options.html
I got an error:
NoSuchCookieError: No cookie with name sbet
at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:550:15)
at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:542:13)
at Executor.execute (node_modules/selenium-webdriver/lib/http.js:468:26)
I use Javascript and [email protected]
The w3c spec says to throw the error you are getting, so that's at least behaving correctly. It looks like the getCookie command needs to add the NoSuchCookie error to the erros it catches here https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/lib/webdriver.js#L1207
@lmtierney yes, I also checked the source code. So you mean the getCookie command need to return null instead of throw NoSuchCookie error? If yes, I probably can help to fix it.
That's up to the maintainer of the nodejs code. If it's to be nil, then the code needs updating. If it's supposed to throw an error then the documentation needs updating. @jleyba
@Harsha509, thank you for fixing this!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
That's up to the maintainer of the nodejs code. If it's to be nil, then the code needs updating. If it's supposed to throw an error then the documentation needs updating. @jleyba