Home > Back-end >  To import WebDriverWait the correct way is to use selenium.webdriver.support.wait or selenium.webdri
To import WebDriverWait the correct way is to use selenium.webdriver.support.wait or selenium.webdri

Time:11-02

from selenium.webdriver.support.wait import WebDriverWait

from selenium.webdriver.support.ui import WebDriverWait

Since I started using Selenium I've always used ui and I've always seen others using ui too, but I'm not finding it in the Selenium documentation and now Pylance is showing this alert:

"WebDriverWait" is not exported from module "selenium.webdriver.support.ui"
Import from "selenium.webdriver.support.wait" instead

Both seem to work, but I didn't find anything warning about which one will become obsolete or anything like that. I would like to understand better what is behind this subject!

CodePudding user response:

As per the official documentation, you have to use:

from selenium.webdriver.support.wait import WebDriverWait

Refer:

https://www.selenium.dev/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.wait.html

  • Related