Selenium - Wait until element is NOT visible

后端 未结 10 2088
生来不讨喜
生来不讨喜 2021-02-02 07:29

In the code below, I attempt to wait until an element is visible:

var wait = new WebDriverWait(Driver.Instance, TimeSpan.FromSeconds(10));
wait.Until(ExpectedCon         


        
10条回答
  •  既然无缘
    2021-02-02 08:17

    I know this is old, but since I was searching for a solution to this, I thought I'd add my thoughts.

    The answer given above should work if you set the IgnoreExceptionTypes property:

    var wait = new WebDriverWait(Driver.Instance, TimeSpan.FromSeconds(10));
    wait.IgnoreExceptionTypes = new[] { typeof(NoSuchElementException) }
    wait Until(driver => !driver.FindElement(By.Id("processing")).Displayed);
    

提交回复
热议问题