简体   繁体   中英

Selenium explicit wait upper limit

I'm using Selenium to do some automated testing in a C# app. I have a component that's not disappearing after the 90 seconds explicit wait. Is there an upper limit to the timeout:

Driver.WaitUntil(ExpectedConditions.InvisibilityOfElementLocated(By.CssSelector("section > h1 > img")), 90);

I haven't found anything indicating there's an upper limit.

Cannot say about explicit wait upper limit, but if you want to make it more you can put the wait in loop. So the loop will make it 90*number of loops.

WebDriverWait constructor is WebDriverWait(IWebDriver, TimeSpan) TimeSpan has several properties, one of them is Days , witch receives double as parameter. So theoretically you can do

WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromDays(double.MaxValue));

And see what happens first, your explicit wait ends or the sun goes supernova :)

(The script will probably crash much sooner).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM