Skip to content

"DevTools Request: 127.0.0.1:12585/json/version. DevTools request failed" when loading Chrome user data with a Chrome window already open #886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
douglasg14b opened this issue Aug 5, 2015 · 4 comments

Comments

@douglasg14b
Copy link

When I create a new chrome driver in Selenium while Google Chrome is already running AND I am referencing the users settings/data (via user-data-dir). A new Chrome window will open, but my application will hang. The ChromeDriver console will display the following error each second:

DevTools Request: 127.0.0.1:12585/json/version. DevTools request failed

This will work perfectly fine in every time if I do not try and load user settings/data. If I am trying to load user setting/data it will only work if there is no instance of Chrome running on the device already.

I am not sure if this is a bug, or my own ignorance. Hopefully the later.

Versions:

  • Selenium v 2.47.0
  • ChromeDriver v 2.16.333243
  • Chrome v44.0.2403

Possibly related to: angular/protractor#1636 ?

Edit: code snippet for reference:

    ChromeDriverService driverService = ChromeDriverService.CreateDefaultService();
    //driverService.HideCommandPromptWindow = true;
    driverService.EnableVerboseLogging = true;

    string path = Environment.ExpandEnvironmentVariables("%LOCALAPPDATA%\\Google\\Chrome\\User Data");

    ChromeOptions options = new ChromeOptions();
    options.AddArguments("user-data-dir=" + path);
    options.AddArguments("--start-maximized");
    options.AddArguments("--disable-extensions");

    IWebDriver driver = new ChromeDriver(driverService, options);
@lukeis
Copy link
Member

lukeis commented Aug 6, 2015

chromedriver issues are tracked on a separate project, please log issues there:

https://code.google.com/p/chromedriver/issues/list

@lukeis lukeis closed this as completed Aug 6, 2015
@kpcool
Copy link

kpcool commented Apr 7, 2016

Its almost 8 months since the problem was closed, but I would like to shed some light into issue and possibly provide a solution to some else who may run into this issue.

Refer to http://stackoverflow.com/a/22735763/2326198 and setup the output log for the Chrome webdriver as mentioned in that post.

After that execute the code that was giving you issue and you will see the reason of failure.

In my case it was ' Gtk: cannot open display'.

HTH,

@yippeykeiyay
Copy link

@kpcool I'm having the same issue - could you possibly post how you fixed it please?

@jkobus
Copy link

jkobus commented Sep 18, 2017

for anyone having problem with codeception and headless chrome, this will save your day:

http://phptest.club/t/how-to-run-headless-chrome-in-codeception/1544

Launch With Selenium Server
Selenium Server should be started:

java -jar ~/selenium-server.jar
And the following config to launch Chrome headlessly:

modules:
  config:
    WebDriver:
      browser: chrome
      window_size: false          
      capabilities:
        chromeOptions:
          args: ["--headless", "--disable-gpu"]
          binary: "/usr/bin/google-chrome"
Valid path to google chrome executable should be set in binary. It must be path to Chrome >= 59+

Launch using ChromeDriver only, without Selenium Server
ChromeDriver v 2.30+ should be installed in global path. Launch it:

chromedriver --url-base=/wd/hub
Use following config to run tests using ChromeDriver, without connecting to Selenium Server:

modules:
  config:
    WebDriver:
      browser: chrome
      port: 9515 # ChromeDriver port
      window_size: false
      capabilities:
        chromeOptions:
          args: ["--headless", "--disable-gpu"]
          binary: "/usr/bin/google-chrome"
Limitations
Headless Chrome does not support (yet):

changing window size (resizeWindow command and window_size config option will throw exceptions)
alerts and popups (acceptPopup, cancelPopup, etc will throw exceptions)
If you need to set initial window size for window-size option to chrome args:

      capabilities:
        chromeOptions:
          args: ["--headless", "--disable-gpu", "window-size=1920x1080"]

refs Codeception/Codeception#4312

@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants