BrowserMob代理-远程服务器返回错误:(404)没有找到BrowserMob Proxy - The remote server returned an error: (404) Not Found

- 此内容更新于:2015-01-06
主题:

原文:

I'm trying to use BrowserMob Proxy with Selenium in C#.

I've tried this solution here: http://www.adathedev.co.uk/2012/02/automating-web-performance-stats.html

And my code looks like this:

Server server = new Server(@"path_to\browsermob-proxy.bat");
server.Start();
Client client = server.CreateProxy();
client.NewHar("test");

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

profile.SetProxyPreferences(seleniumProxy);
IWebDriver driver = new FirefoxDriver(profile);

When I run the test I get the following error:

System.Net.WebException: The remote server returned an error: (404) Not Found.

It fails at the third line.

Any suggestions on how to get this working? Thank you.