Export in FiddlerCore doesn't work
I'm using FiddlerCore in my Selenium project. It captures all th开发者_StackOverflowe sessions but I cannot perform export - DoExport method always returns false. Could you please help me? Here is my code:
IWebDriver driver = new InternetExplorerDriver();
Fiddler.FiddlerApplication.Startup(8877, FiddlerCoreStartupFlags.Default);
var items = new List<Fiddler.Session>();
Fiddler.FiddlerApplication.AfterSessionComplete += delegate(Fiddler.Session oS)
{
items.Add(oS);
};
driver.Navigate().GoToUrl("http://google.comm");
FiddlerApplication.oTranscoders.ImportTranscoders(@"C:\\FiddlerCore-BasicFormats.dll");
var oExportOptions = new Dictionary<string, object>();
string filename = @"C:\output.har";
oExportOptions.Add("Filename", filename);
Fiddler.FiddlerApplication.DoExport("HTTPArchive v1.2", items.ToArray(), oExportOptions, null);
Fiddler.FiddlerApplication.Shutdown();
Attach event handlers like so:
Fiddler.FiddlerApplication.OnNotification += delegate(object sender, NotificationEventArgs oNEA) { Console.WriteLine("** NotifyUser: " + oNEA.NotifyString); };
Fiddler.FiddlerApplication.Log.OnLogString += delegate(object sender, LogEventArgs oLEA) { Console.WriteLine("** LogString: " + oLEA.LogString); };
...and I bet you'll find a console notification indicating that your ImportTranscoders() call is failing.
精彩评论