Selenium C# WebDriver: Wait until element is present

前端 未结 24 3231
礼貌的吻别
礼貌的吻别 2020-11-22 08:53

I want to make sure that an element is present before the webdriver starts doing stuff.

I\'m trying to get something like this to work:

WebDriverWait w         


        
24条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 09:49

    Try this code:

     New WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(Function(d) d.FindElement(By.Id("controlName")).Displayed)
    

提交回复
热议问题