Rongeegee
Rongeegee

Reputation: 1128

Is WebDriverWait(WebDriver driver, long timeoutInSeconds) from Selenium deprecated?

I code on Eclipse, and I used Selenium on Maven. When I use WebDriverWait(WebDriver driver, long timeoutInSeconds) function on Eclipse, Eclipse gave me the following warning:

The constructor WebDriverWait(WebDriver, long) is deprecated. 

If I view the function on the source code of Selenium, It also indicates that it's deprecated.

However, if I go to Selenium's official document in https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/support/ui/WebDriverWait.html, it indicates that WebDriverWait(WebDriver, long) is not deprecated. The deprecated one is the another method that shares the same method name but different parameters.

I use Selenium 4.0.0, which should be the latest version as of now. So, is it deprecated or not?

Upvotes: 0

Views: 1353

Answers (1)

SiKing
SiKing

Reputation: 10329

Documentation is always outdated! :)

There is only one source of truth, the actual source: https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/support/ui/WebDriverWait.java#L44 says:

@deprecated Instead, use WebDriverWait#WebDriverWait(WebDriver, Duration).

As a side note: in your Eclipse, after you download the source using your Maven, you should be able to follow to the source (press [F3]) to get to this same information.

Upvotes: 1

Related Questions