我正在使用 firefox12
并下载firebug-1.9.0.xpi
& netExport-0.5.xpi
,但未创建 har 文件。可以做的任何改变。程序代码:
class Program
{
public IWebDriver webDriver;
public InternetExplorerDriver IEDriver;
static void Main(string[] args)
{
{
FirefoxProfile profile = new FirefoxProfile();
IWebDriver webDriver = new FirefoxDriver();
try
{
profile.AddExtension(@"D:\LoadTesting\firebug-1.9.0.xpi");
profile.AddExtension(@"D:\LoadTesting\netExport-0.5.xpi");
}
catch (IOException err)
{
}
profile.SetPreference("app.update.enabled", false);
String domain = "extensions.firebug.";
string output_dir =
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
output_dir = Path.Combine(output_dir, "Firebugnetexports");
if (!Directory.Exists(output_dir))
{
Directory.CreateDirectory(output_dir);
}
profile.SetPreference(domain + "currentVersion", "1.8.2");
profile.SetPreference(domain + "allPagesActivation", "on");
profile.SetPreference(domain + "defaultPanelName", "net");
profile.SetPreference(domain + "net.enableSites", true);
profile.SetPreference(domain + "netexport.alwaysEnableAutoExport", true);
profile.SetPreference(domain + "netexport.showPreview", false);
profile.SetPreference(domain + "netexport.defaultLogDir", output_dir);
try
{
webDriver.Navigate().GoToUrl("http://www.janodvarko.cz");
}
catch (Exception ex)
{
}
webDriver.Quit();
}
}
}