GetHar() via BMP+ Selenium in C#

145 views
Skip to first unread message

Peng Yang

unread,
Aug 19, 2019, 5:24:12 PM8/19/19
to BrowserMob Proxy
Hello,

Here is my C# code and it's working find to get har data entries.
However, for certain URL when I opened Chrome DevTool Network track, there is "Request Payload", but I didn't see it in returned har results from C# code.
Do I need to add some additional configuration on browser/BMP or there is no way to do it?


            Server server = new Server(@"C:\Users\User\Desktop\browsermob-proxy-2.1.4-bin\browsermob-proxy-2.1.4\bin\browsermob-proxy.bat");
            server.Start();
            Thread.Sleep(1000);
            Client client = server.CreateProxy();
            ChromeOptions co = new ChromeOptions();
            client.NewHar("Test");

            co.AddArguments("--ignore-certificate-errors");
            co.AddArguments("--user-data-dir=C:\\HARTEST");
            var seleniumProxy = new Proxy { HttpProxy = client.SeleniumProxy , SslProxy = client.SeleniumProxy};
            co.Proxy = seleniumProxy;
            co.AcceptInsecureCertificates= true;
            var  dr = new ChromeDriver(co);
            dr.conten


            dr.Navigate().GoToUrl("https://www.nuget.org");
            HarResult harData = client.GetHar();


Thanks.




Reply all
Reply to author
Forward
0 new messages