开发者

Export in FiddlerCore doesn't work

开发者 https://www.devze.com 2023-03-25 18:28 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消