public string ToAttribute() { string result; string finder = FindMethod.ToString() != "Href" ? FindMethod.ToString() : "Url"; string findvalue = FindValue.Replace("\"", "\\\""); if (string.IsNullOrEmpty(FindName)) { result = "FindBy(" + finder + " = \"" + findvalue + "\")"; } else { result = "FindBy(" + finder + " = \"" + FindName + "\", \"" + findvalue + "\")"; } return(result); }
public override string ToString() { string result; string finder = FindMethod.ToString() != "Href" ? FindMethod.ToString() : "Url"; string findvalue = ""; try { findvalue = FindValue != null?FindValue.Replace("\"", "\\\"") : ""; } catch (Exception) { } if (string.IsNullOrEmpty(FindName)) { result = "Find.By" + finder + "(\"" + findvalue + "\")"; } else { result = "Find.By" + finder + "(\"" + FindName + "\", \"" + findvalue + "\")"; } return(result); }