Traceback - XXOK/XXOK-selenium GitHub Wiki

Traceback

Error์˜ ๋ฐœ์ƒ ์œ„์น˜๋ฅผ ์ถ”์ ํ•  ์ˆ˜ ์žˆ๋Š” Call stack์„ ์ถœ๋ ฅํ•ด์ค€๋‹ค.

except Exception ๋™์ž‘ ์‹œ ํ•จ์ˆ˜๊ฐ€ ์‹คํ–‰๋˜๋„๋ก ๊ตฌํ˜„ํ•˜์˜€๋‹ค.

import sys, traceback

try:
    ...

except Exception:
    traceback.print_exc(file=sys.stdout)  # ์—๋Ÿฌ์Šคํƒ ์ •๋ณด๋ฅผ stdout์œผ๋กœ print
    print("์—๋Ÿฌ ๋ฐœ์ƒ ํŽ˜์ด์ง€ URL : ", self.driver.current_url) # ์ตœ์ข… page url ์ ์–ด์ฃผ๊ธฐ

Result

wwwauto/test_suite.py::detail_oneroomTest::runTest <- wwwauto/www_03_detail_oneroom.py Traceback (most recent call last):
  File "/Users/yeonsin/XXOK-selenium/wwwauto/www_03_detail_oneroom.py", line 59, in runTest
    self.wait.until(EC.visibility_of_element_located((By.CLASS_NAME, 'has_d21'))).click() # ์—๋Ÿฌ ๋ฐœ์ƒ ์ฝ”๋“œ
  File "/Users/yeonsin/selenium/lib/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until
    raise TimeoutException(message, screen, stacktrace) # ์—๋Ÿฌ ๋ฐœ์ƒ ์›์ธ
selenium.common.exceptions.TimeoutException: Message: 

์—๋Ÿฌ ๋ฐœ์ƒ ํŽ˜์ด์ง€ URL :  https://www.zigbang.com/