element – Selenium- web driver wait

Here is an example of a function that wait few secounds until an elements is visible.

    public System.Collections.ObjectModel.ReadOnlyCollection<OpenQA.Selenium.IWebElement> ById(IWebDriver driver, string Identifer)
    {
        var k = new WebDriverWait(driver, new TimeSpan(0, 0, 7)).Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Id(Identifer)));

        return k;

I would like to write a function which wait as long as it need until the element will be exists, or visible.. It just should wait until everything is able to catch.

Read more here: Source link