I have difficulty in an if test where I wan't to test if the text of my element is equel to a string. I'm doing it like this :
WebElement vote1 = chromeDriver.FindElementByXPath("//*[@data-website-id=\"4\"]");
Console.WriteLine(vote1.GetAttribute("text"));
if (vote1.GetAttribute("text").Equals("Vote N°1 [1H30]"))
{
Console.WriteLine("Votable");
chromeDriver.FindElementByXPath("//*[@data-website-id=\"4\"]").Click();
}
But while doing this my console is showing me this : Console result
Because the first writeline give me the exact same text that in the equals, I don't understand why the if is false. What am I doing wrong ?