is WebDriverWait is deprecated in Selenium4?
It doesn’t appear in the docs, but if you look at the source code you will see @Deprecated annotation
@Deprecated public WebDriverWait(WebDriver driver, long timeoutInSeconds) { this(driver, Duration.ofSeconds(timeoutInSeconds)); } In the constructor description you have the solution
@deprecated Instead, use {@link WebDriverWait#WebDriverWait(WebDriver, Duration)}.
Which is the constructor being called from the deprecated one in any case.
new WebDriverWait(driver, Duration.ofSeconds(10));