I am trying to assert list of string that contains URL extracted from href attributes of elements using Selenium C#. Below is my code and when i am running its given false.
public static void Main()
{
List<string> urlList = new List<string>();
// Adding elements to List
urlList.Add("https://www.google.com");
urlList.Add("/app/facebook");
urlList.Add("https://www.gmail.com");
// Checking whether string is present
// in List or not
Console.Write(urlList.Contains("google"));
}
OUTPUT: False
>Solution :
try this
Console.Write(urlList.Any(x => x.Contains("google")));