Reputation: 75
I've ran this script daily for the last few months, and for some reason, today when it tries to to start, it throws this error:
There was an error while the code was executing.
SessionNotCreatedError session not created exception from unknown error:
Runtime.executioncontextCreated has invalid 'context':{"auxData":{frameId":"4120.1","isDefault":true, "id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.59)
(Driver info: chromedriver=2.21371459
(36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4, platform=Windows NT 6.1 SP1 x86_64)
Here's my code:
Dim drvSelenium As New Selenium.ChromeDriver
drvSelenium.SetPreference "download.default_directory", MyFilePathHere
drvSelenium.SetPreference "download.directory_upgrade", True
drvSelenium.SetPreference "download.extensions_to_open", ""
drvSelenium.SetPreference "download.prompt_for_download", False
drvSelenium.Start "chrome", "http://www.google.com"
And it throws that error when it gets to the last line, and I'm not sure what changed. I may have had some windows updates run over night, but I can't put my finger on what would cause this to not work all of a sudden :(
Upvotes: 0
Views: 3093
Reputation: 75
When I downloaded the 2.24 version from:
http://chromedriver.storage.googleapis.com/index.html?path=2.24/
Once unzipped and ran, it opened the command prompt and displayed "Only local connections are allowed." However, my code was still throwing an error. Turns out that it is functioning as intended.
What I ended up doing that solved the problem is going to "C:\Program Files\SeleniumBasic" and renaming the current "chromedriver.exe" to "chromedriver21.exe" and then copying and pasting the "chromedriver.exe" that I downloaded from the above link into that folder.
Now when my code execute, it is using the 2.24 executable and works absolutely fine.
I'm sure this is a no-brainer easy solution for most, if not everyone else. But it seems that updating this driver should be a bit more straight forward, and maybe it is and I just missed it.
I didn't read through this before I figured out a solution, but this may be a better resource for people like me:
https://sites.google.com/a/chromium.org/chromedriver/getting-started
Also, this is where I started that didn't point me in the right direction very well, and I'm adding it to summarize my journey:
http://www.seleniumhq.org/download/
Upvotes: 1