cant get capture response using chrome dev tools c#

911 views
Skip to first unread message

Yidel Brach

unread,
Dec 15, 2022, 2:28:05 AM12/15/22
to Selenium Users
code:
driver = new ChromeDriver();

                    driver.Manage().Window.Maximize();
                    //selenuim sets navigator.webdriver to true, causing the singin button not to work, disable this functino here
                    IDevTools devTools = driver as IDevTools;
                    DevToolsSession session = devTools.GetDevToolsSession();
                    domains = session.GetVersionSpecificDomains<DevToolsSessionDomains>();
                    domains.Page.Enable(new OpenQA.Selenium.DevTools.V108.Page.EnableCommandSettings());
  domains.Network.Enable(new OpenQA.Selenium.DevTools.V108.Network.EnableCommandSettings());

     var cmd = new OpenQA.Selenium.DevTools.V108.Network.GetResponseBodyCommandSettings();
                        cmd.RequestId = e.RequestId;
                        var data = domains.Network.GetResponseBody(cmd).Result;
                        var str = data.Body;
exception thrown: 
response:
A command response was not received: Network.getResponseBody

Vinayak S Kori

unread,
Dec 26, 2022, 6:20:36 AM12/26/22
to seleniu...@googlegroups.com

There are a few possible reasons why you might be getting the exception you mentioned:

  1. The network request might have failed or been cancelled before the response body could be retrieved. You can check the network logs in the DevTools console to see if the request completed successfully.

  2. There might be an issue with the DevTools connection. Make sure that the DevTools session is properly established and that the GetResponseBody command is being sent after the session is started.

  3. There might be an issue with the GetResponseBody command itself. Make sure that you are using the correct version of the command for the version of the DevTools protocol that you are using.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/69b6378a-7652-4bbe-916d-8b98d399a524n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages