Пример #1
0
        public override void AddRequest(Fiddler.Session req, string stepName)
        {
            // NP 12/07/2013
            // Dejo afuera los pedidos de Google Analytics (movido para la función filtrarPedidos para poder notificar los descartes)
            // NP 27/01/2014
            // Dejo afuera los pedidos de la blacklist

            if (FiltrarPedidos(req))
            {
                return;
            }

            /*if (req.oRequest.headers.Exists("Cookie"))
             * {
             *  string[] separador = { "Cookie: " };
             *  string[] cookies = req.oRequest.headers.ToString().Split(separador, StringSplitOptions.None);
             *  separador[0] = "; ";
             *  foreach (string cookie in cookies[1].Split(separador, StringSplitOptions.None))
             *  {
             *      if (cookie.StartsWith("__utm")) return;
             *  }
             * }*/

            var isPrimaryReq = SessionUtils.IsPrimaryReq(req);
            var reqCode      = new RequestSection(req, this, stepName, ParametrizedValues, isPrimaryReq);

            if (isPrimaryReq)
            {
                Sections.Add(reqCode);
            }
            else
            {
                //agrego un include para poner el pedido secundario
                var lastIncludedSection = Sections[Sections.Count - 1] as IncludedScriptSection;
                if (lastIncludedSection == null)
                {
                    lastIncludedSection = new IncludedScriptSection(Name.Replace(".htp", "") + "_" + _lastIncludedScript, OpenSTARep, this);
                    _lastIncludedScript++;
                    Sections.Add(lastIncludedSection);
                }

                lastIncludedSection.AddRequest(req, stepName);
            }
        }
Пример #2
0
        public override void AddRequest(Fiddler.Session req, string stepName)
        {
            var isPrimary = SessionUtils.IsPrimaryReq(req);
            var reqCode   = new RequestSection(req, this, stepName, ParametrizedValues, isPrimary);

            if (isPrimary)
            {
                Sections.Add(reqCode);
            }
            else
            {
                //Agrego un "include" para poner el pedido secundario
                var lastIncludeSection = Sections[Sections.Count - 1] as IncludedScriptSection;
                if (lastIncludeSection == null)
                {
                    lastIncludeSection = new IncludedScriptSection(Name.Replace(".htp", "") + "_" + _lastIncludedScript, OpenSTARep, this);
                    _lastIncludedScript++;
                    Sections.Add(lastIncludeSection);
                }

                lastIncludeSection.AddRequest(req, stepName);
            }
        }