I am automating engineer using ranorex with c# and have a client requirement as below
1.we have scheduled few test cases to run daily 2.If any particular test case fails the https requests should be tracked for this failed cases
I have googled and found that we need to use fiddlercore and have written script as below
1.Fiddler.FiddlerApplication.Startup(8877, true, true);
2.var items = new List<Fiddler.Session>();
3.Fiddler.FiddlerApplication.AfterSessionComplete += delegate(Fiddler.Session oS)
4.{
5. items.Add(oS);
6.};
7.Fiddler.FiddlerApplication.OnNotification += delegate(object sender, NotificationEventArgs oNEA)
8.{ Console.WriteLine("** NotifyUser: " + oNEA.NotifyString); };
9.Fiddler.FiddlerApplication.Log.OnLogString += delegate(object sender, LogEventArgs oLEA) { 10.Console.WriteLine("** LogString: " + oLEA.LogString); };
//Open url
//steps in testcase
FiddlerApplication.oTranscoders.ImportTranscoders( @"C:\EZPrints_VL_Demo\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();
but after executing this I am not able to see any file created with name "output.har" and also when I debug after 3rd step execution is not going to 5th step inside loop it is going to 7th step.
My question is
- Does my approach meet my requirement. Will it track all sessions of my entire testcase. If not, what updates I need to do it make it so? 2.If my approach is correct am I missing something which is stopping me from generating output?