fysh711426 / UndetectedChromeDriver

GNU General Public License v3.0
166 stars 61 forks source link

Not working with DevTools Chrome Driver v102.0.5005.61 #3

Open aadi1295 opened 2 years ago

aadi1295 commented 2 years ago

Hello, I am trying to use this with DevTools and my Chrome Driver version is 102.0.5005.61 on .NET 6.0 WPF C#, I want to capture all XHR traffic. It starts the driver and browser and welcome screen but then stuck and doesn't go to the URL. Can you please test it with DevTools. Thank you My code is

    using OpenQA.Selenium.Chrome;
    using OpenQA.Selenium.DevTools;
    using SeleniumUndetectedChromeDriver;
    using DevToolsSessionDomains = OpenQA.Selenium.DevTools.V102.DevToolsSessionDomains;
    using Network = OpenQA.Selenium.DevTools.V102.Network;

    protected string driverExecutablePath = $@"D:\SeleniumProfiles\chromedriver.exe";
    protected UndetectedChromeDriver driver;
    protected IDevToolsSession session;

        try
        {
            var options = new ChromeOptions();
            options.AddArgument("--mute-audio");
            options.AddArgument("--disable-gpu");
            options.AddArgument("--disable-dev-shm-usage");
            driver = UndetectedChromeDriver.Create(
               options: options,
               driverExecutablePath: driverExecutablePath);

            IDevTools devTools = driver as IDevTools;
            session = devTools.GetDevToolsSession();

            var domains = session.GetVersionSpecificDomains<DevToolsSessionDomains>();
            domains.Network.Enable(new Network.EnableCommandSettings());
            domains.Network.SetBlockedURLs(new Network.SetBlockedURLsCommandSettings()
            {
                Urls = new string[] { "*://*/*.css" }
            });

            driver.GoToUrl("https://nowsecure.nl");
        }
        catch (Exception ex)
        {
        }
fysh711426 commented 2 years ago

My chrome is version 101, here is my test result. Does your code execute to GoToUrl, or throw the exception before that?

1653805755513

fysh711426 commented 2 years ago

Is your problem like this? https://github.com/fysh711426/UndetectedChromeDriver/issues/4

Is this a problem with the code? or do you have a custom chrome install path?