반응형

셀레니움, NameError: name 'StaleElementReferenceException' is not defined

 

수알치 오상문

 

셀레니움 예외는 표준 예외가 아니므로 사용할 예외를 직접 임포트해야 한다.

 

from selenium.common.exceptions import StaleElementReferenceException

 

마찬가지로 NoSuchElementException 예외를 다루고 싶다면 아래처럼 임포트한다.

 

from selenium.common.exceptions import NoSuchElementException

 

[참고] 셀레니움 일반 예외 목록

  • NoSuchWindowException
  • NoSuchFrameException
  • NoSuchElementException
  • NoAlertPresentException
  • InvalidSelectorException
  • TimeoutException
  • ElementNotVisibleException
  • ElementNotSelectableException
  • NoSuchSessionException
  • StaleElementReferenceException

[참조] 셀레니움 예외 종류

https://www.thepsi.com/what-are-the-common-selenium-exceptions-and-how-to-handle-them/

 

What are the Common Selenium Exceptions and How to Handle Them? - Pratham Software™

Faster Feedback, Accelerated Results, Reduced Business Expenses, Reusability and beyond. The benefits of automation testing are never-ending. However, errors and exceptions are something that a testing environment must deal with daily. What are Errors and

www.thepsi.com

 

반응형

+ Recent posts