I know that selenium webdriver can do that:
var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.ClassName("someclass")));
can't I do that on my method? For example I have a method which takes a screenshot and compares with another picture. I want to wait until that method returns true.
So I have this code
while (WelcomeScreen(driver) != true)
{
Thread.Sleep(1000);
}
Can't I find any better solution?