I have a while loop that is using Selenium to check for a string on a web page. The value returned is exactly the same as the value it is being evaluated against. But for some reason, it is saying that the strings are not equal. But they are equal. The code is below. I have tried several things to combat this with no luck. What am I doing wrong? So basically the IF statement is saying that red does not equal red.
private void LookForString()
{
try
{
while (true)
{
IWebElement curStatus = ieDriver.FindElement(By.Id("sitestatus"));
if (!curStatus.Text.Equals(r.statusClosed))
{
break;
}
}
}
catch (Exception) { RestartProgram(); }
Aucun commentaire:
Enregistrer un commentaire