mardi 29 décembre 2015

Does the OR operator cause an DisconnectedContext exception when used in a if statement?

Well yeah, does the OR operator cause an DisconnectedContext exception when used like this:

bool l = driver.Url.Contains("something");
bool l2 = driver.FindElement(By.CssSelector("#Csssomthing")).IsElementVisible();
if (l || l2)
{
    //do something 
}

public static bool IsElementVisible(this IWebElement element)
    {
        return element.Displayed && element.Enabled;
    }

It throws the DisconnectedContext exception the moment it reaches bool l2 and the unit test fails, so can any one tell me what the issue actually is?

Aucun commentaire:

Enregistrer un commentaire