Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

selenum wait for element c#

public static bool elexists(By by, WebDriver driver)
    {
        try
        {
            driver.FindElement(by);
            return true;
        }
        catch (NoSuchElementException)
        {
            return false;
        }
    }
    public static void waitforelement(WebDriver driver, By by)
    {
        for (int i = 0; i < 30; i++)
        {
            System.Threading.Thread.Sleep(1000);
            if (elexists(by, driver))
            {
                break;
            }


        }

    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #selenum #wait #element
ADD COMMENT
Topic
Name
9+4 =