I Need to wait for an element to be NOT visible and found a couple of solutions for this, but none of them seems to work for me.
I think the problem is because I'm using PageObject Models. but I'm not complete sure.
public static void WaitForElementToBeInvisible(this Browser browser, IWebElement element, int seconds = 30)
{
var wait = new WebDriverWait(browser.Driver, new TimeSpan(0, 0, seconds));
wait.Until(ExpectedConditions.InvisibilityOfElementLocated(element));
}
But it returns error cannot convert from IWebElement to Selenium.By
Thanks in advance