2016-04-25 7 views
1

したがって、Browsermob Proxyを試すための私の基本的なコードは以下の通りです。 この問題は、(1)不完全な数、(2)Devツール(FirefoxまたはChrome)のネットワーク統計を手動でチェックするほど詳細ではないと思われる出力に問題があります。Browsermobプロキシ - HARファイルはマニュアルHARほど完全ではありませんか?

HARファイルに詳細情報を含めることはできますか? たとえば、特定のJavascriptがロードされている場合は、(またはもっと良い解決策がありますか?)を知りたいと思います。コンソールで

 // Supply the path to the Browsermob Proxy batch file 
     Server server = new Server(@"C:\Users\Frederik\Desktop\SeleniumTestje\browsermob-proxy-2.1.0-beta-6\bin\browsermob-proxy.bat"); 
     server.Start(); 

     Client client = server.CreateProxy(); 
     client.NewHar("google"); 

     var seleniumProxy = new Proxy { HttpProxy = client.SeleniumProxy }; 
     var profile = new FirefoxProfile(); 

     profile.SetProxyPreferences(seleniumProxy); 
     // Navigate to the page to retrieve performance stats for 
     IWebDriver driver = new FirefoxDriver(profile); 
     driver.Navigate().GoToUrl("http://www.google.co.uk"); 

     // Get the performance stats 
     HarResult harData = client.GetHar(); 
     foreach(Entry e in harData.Log.Entries) 
     { 
      Console.WriteLine(e.Request.Url, e.Request.Headers); 
     } 

出力:

http://ocsp.digicert.com/ 
http://ocsp.digicert.com/ 
http://ocsp.digicert.com/ 
http://www.google.co.uk/ 
http://clients1.google.com/ocsp 
http://clients1.google.com/ocsp 
http://clients1.google.com/ocsp 
http://clients1.google.com/ocsp 

答えて

関連する問題