'Selenium ChromeDriver 101.0.4951.41 cannot start DevTools

enter image description here

Hi. I tried upgrade my chromedriver to 101.0.4951.41 today and it sudden keep prompt this error to me. Anything I missed or what I should add for new version?

And this is my code:

    options.AddArgument("start-maximized");
    options.AddArgument("--disable-extensions");
    options.AddArgument("--disable-blink-features");
    options.AddArgument("--disable-blink-features=AutomationControlled");
    options.AddArgument("--disable-gpu");
    options.AddArgument("--no-sandbox");
    options.AddArgument("--allow-running-insecure-content");
    options.AddArgument("--ignore-certificate-errors");
    options.AddArgument("--disable-background-networking");

    options.AddExcludedArguments(new List<string>() { "enable-automation" });
    options.AddUserProfilePreference("credentials_enable_service", false);
    options.AddUserProfilePreference("password_manager_enabled", false);

    ChromeDriverService chromeDriverService=ChromeDriverService.CreateDefaultService();
    chromeDriverService.HideCommandPromptWindow = true;

    IWebDriver Driver = new ChromeDriver(chromeDriverService, options);

    IDevTools devTools = Driver as IDevTools;
    IDevToolsSession session = devTools.GetDevToolsSession();


Solution 1:[1]

Fixed by adding the protocol version (i.e.)

using DevTools = OpenQA.Selenium.DevTools.V96; : : IDevTools devTools = webDriver as IDevTools; IDevToolsSession session = devTools.GetDevToolsSession(96);

Solution 2:[2]

Had a similar issue and it seems in versions above and equal 100 need to have the remote-debugging-port argument set.

Add this to args:

"--remote-debugging-port=9222"

Solution 3:[3]

This opens the devtools for me when I open the driver itself. I tested it on version 101.0.4951.41 so it should work fine for you. (no remote debugging port required)

options.AddArgument("--auto-open-devtools-for-tabs");

Solution 4:[4]

Apparently the new version of chromedriver (101.0.4951.41) is not compatible with old version of DevTools

I can solved this issue updated Selenium.WebDriver to 4.1.1 and used "OpenQA.Selenium.DevTools.V101.Network"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 escame
Solution 2 misantroop
Solution 3 Isaac M
Solution 4 Matías P