0
我正在使用Visual Studio 2013和C#,試圖看看它是如何工作的。 我想保存一個JSON文件並閱讀它,但這是爲了以後的一部分。如何使用NetExport保存HAR文件?
HAR文件NetExport應該創建的永遠不會被保存。 我在這裏做錯了什麼?
protected void Page_Load(object sender, EventArgs e)
{
FirefoxProfile profile = new FirefoxProfile();
profile.AddExtension("netExport-0.9b7.xpi");
profile.AddExtension("firebug-2.0.7-fx.xpi");
// profile.SetPreference("app.update.enabled", false);
string domain = "extensions.firebug.";
profile.SetPreference(domain + "currentVersion", "2.0.7");
profile.SetPreference(domain + "allPagesActivation", "on");
profile.SetPreference(domain + "defaultPanelName", "net");
profile.SetPreference(domain + "net.enableSites", true);
// Set default NetExport preferences
profile.SetPreference(domain + "netexport.alwaysEnableAutoExport", true);
profile.SetPreference(domain + "netexport.showPreview", false);
profile.SetPreference(domain + "netexport.defaultLogDir",
"C:\\Users\\MyName\\Desktop\\HAR\\");
IWebDriver driver = new FirefoxDriver(profile);
System.Threading.Thread.Sleep(5000);
driver.Navigate().GoToUrl("http://www.google.com/");
System.Threading.Thread.Sleep(5000);
driver.Quit();
}