Gershon Papi
Gershon Papi

Reputation: 5106

Selenium Chromedriver: Failed to create channel

I've been using Selenium Chromedriver for the last couple of weeks and suddenly I've got this weird error. I don't know what's changed suddenly.

[2560:6100:1025/082057:ERROR:browser_gpu_channel_host_factory.cc(125)] Failed to create channel.
[ERROR] Unhandled exception occured. SessionNotCreatedError: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"9556.1","isDefault":true},"id":1,"name":"","origin":"://"}
  (Session info: chrome=54.0.2840.71)
  (Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 10.0.14393 x86_64)

I'm running the chromedriver with Node.js:

var selenium = require("selenium-webdriver/chrome"),
        options = new selenium.Options(),
        service = new selenium.ServiceBuilder().build();

    options.addArguments(["--disable-web-security", "-incognito"]);
    var driver = new selenium.Driver(options, service);
    driver.get(fetchSource.url).then(function() {
        browser = driver;
        fetchSource.ready = true;
        console.log("Ready to fetch data.");
    });

Updating the chronedriver version didn't help. Any idea how to solve this error? Thanks!

Upvotes: 1

Views: 2040

Answers (1)

Gershon Papi
Gershon Papi

Reputation: 5106

Turned out chrome updated itself, and the new version wasn't compatible with chromedriver for some reason. Running an older version of chrome solved the problem. In Node.js you can customize the path for the runnable chrome by changing the options object:

options.setChromeBinaryPath('path\to\chrome');

Upvotes: 1

Related Questions