selenium in python : NoSuchElementException: Message: no such element: Unable to locate element

No Such Element Exception usually comes when web driver can’t see the element you are trying to perform an action on.
Reason’s can be:

  1. your ID or Name or Xpath or CssSelector can be wrong.

  2. Your element might be inside an an iframe so that web driver can’t see or detect it. Switch to an iframe through Selenium and python

  3. Your element is taking time to appear on the UI, so you can use an explicit wait to solve
    this. https://selenium-python.readthedocs.io/waits.html

Leave a Comment

tech