Selenium unit tests in Python — where is my log file?

前端 未结 1 1223
太阳男子
太阳男子 2021-01-21 19:07

So I exported some unit tests from the Selenium IDE to Python. Now I\'m trying to debug something, and I\'ve noticed that Selenium uses the logging module. There

相关标签:
1条回答
  • 2021-01-21 19:25

    In your unit test script, place

    import logging
    logging.basicConfig(filename = log_filename, level = logging.DEBUG)
    

    where log_filename is a path to wherever you'd like the log file written to.

    Without the call to logging.basicConfig or some such call to setup a logging handler, the LOGGER.debug command does nothing.

    0 讨论(0)
提交回复
热议问题