Logging / Reports
Logging, Screenshots, and Reports¶
Log files in SeleniumBase/examples/example_logs were generated when test_fail.py ran and failed. During test failures, logs and screenshots get saved to the
latest_logs/ folder. If
--archive-logs is set, test logs will get archived to the
pytest test_fail.py --browser=chrome nosetests test_fail.py --browser=firefox
Examples of expected log files generated during failures:
In addition to logging, you can also generate test reports:
Reports are most useful when running large test suites. Pytest and Nosetest reports are handled differently.
--html=report.html gives you a fancy report of the name specified after your test suite completes.
pytest test_suite.py --html=report.html
--report option gives you a fancy report after your test suite completes.
nosetests test_suite.py --report --browser=chrome
(NOTE: You can add
--show-report to immediately display Nosetest reports after the test suite completes. Only use
--show-report when running tests locally because it pauses the test run.)