Skip to content
CodeKruPro

Why does new WebDriverWait(driver, 10) not compile?

QuizEasy-MediumJava onlyAsked in: Accenture, Infosys, Wipro

Old tutorial code new WebDriverWait(driver, 10) does not compile against Selenium 4.45. Why?

  • Selenium 4 waits and timeouts take java.time.Duration; the seconds-as-a-number constructor is gone
  • WebDriverWait was removed; use FluentWait only
  • The driver must be cast to RemoteWebDriver first
  • The timeout must be in milliseconds: new WebDriverWait(driver, 10000)

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in