Book Image

Learning Selenium Testing Tools with Python

By : UNMESH GUNDECHA
Book Image

Learning Selenium Testing Tools with Python

By: UNMESH GUNDECHA

Overview of this book

Table of Contents (17 chapters)
Learning Selenium Testing Tools with Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Generating the HTML test report


The unittest library generates the test output on a console window. You might want to generate a report of all the tests executed as evidence or to distribute test results to various stakeholders. Sending console logs to the stakeholder may not be a good idea. Stakeholders will need nicely formatted, summary reports with a drill-down access to the details. The unittest library does not have an in-built way to generate nicely formatted reports. We can use the HTMLTestRunner extension of unittest written by Wai Yip Tung. You can find more about HTMLTestRunner at https://pypi.python.org/pypi/HTMLTestRunner along with the download instructions.

Note

The HTMLTestRunner extension is bundled with the book's source code.

We will use HTMLTestRunner in our test to generate a nice-looking report. Let's modify the test suite file that we created earlier in the chapter and add HTMLTestRunner support. We need to create an output file that will contain the actual report, configure...