FiddlerCore中的导出不起作用

时间:2011-08-02 06:57:39

标签: fiddler selenium-webdriver

我在Selenium项目中使用FiddlerCore。它捕获所有会话但我无法执行导出 - DoExport方法始终返回false。请你帮助我好吗? 这是我的代码:

        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();

1 个答案:

答案 0 :(得分:0)

附上事件处理程序,如下所示:

  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); };

...我打赌你会找到一个控制台通知,表明你的ImportTranscoders()调用失败了。