public IncludedScriptSection(string name, Repository repo, ScriptSCL mainScript) { Name = name; _rep = repo; ParentScript = mainScript; _sections.Add(new PlainCode("!Browser:IE5 \n")); _sections.Add(new PlainCode("if (debug=\"0\") then\n")); }
public RequestSection(Session req, ScriptSCL script, string stepName, Dictionary <string, ParametrizedValue> parametrizedValues, bool isPrimary) { Request = req; Script = script; StepName = stepName; _parametrizedValues = parametrizedValues; Validation = null; _result = WriteCodeInt(isPrimary); }
private string SplitAndParametrizeUrl(string fullURL, ScriptSCL Script) { var server = Request.host; Script.OpenSTARep.Global.AddConstant("Server", "\"" + server); var result = fullURL.Replace(fullURL.Contains(server) ? server : Request.host, "\"+Server+\""); //saco la comilla inicial y el ultimo caracter & result = OpenSTAUtils.SplitStringIfNecesary(result, 50); //result = result.Substring(0, result.Length - 2); if (!result.StartsWith("\"")) { result = "\"" + result; } return(result); }
/// <summary> /// Devuelve un string con las cookies parametrizadas y agrega variables si es necesario /// </summary> /// <param name="hTTPRequestHeaders"></param> /// <param name="scriptSCL"></param> /// <returns></returns> internal static string GetCookies(Fiddler.HTTPRequestHeaders hTTPRequestHeaders, ScriptSCL scriptSCL) { const string inicial = "\t\"Cookie: "; var result = inicial; //llamar a OpenSTAUtils para que corte el stirng si es necesario foreach (Fiddler.HTTPHeaderItem item in hTTPRequestHeaders) { if (!item.Name.ToLower().Contains("cookie")) { continue; } var cookies = item.Value.Split(';'); foreach (var cookie in cookies) { if (cookie.Contains("__utm") || BuscarEnArchivoCookies(cookie)) {//cookies de analitics o blacklisteadas result += cookie + ";"; } else { var cookieName = cookie.Split('=')[0]; //string cookieValue = cookie.Split('=')[1]; var var = new Variable(cookieName, "CHARACTER*1024", VariablesScopes.Local); scriptSCL.AddVariable(var); result += "\"+" + var.Name + "+\";"; } } } if (result.EndsWith("+\";")) { result = result.Substring(0, result.Length - "+\";".Length); } else // NP 15/07/2013 si termina con una cookie de google analytics le saco el ; final y le cierro las comillas { result = result.Substring(0, result.Length - 1); result += "\""; } if (result == inicial) { result = result + "\""; } result = OpenSTAUtils.SplitStringIfNecesary(result, "\t\t\t"); return(result); }