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

<p>Selenium WebDriver is a popular automated testing tool for web applications. Python is one of the top programming languages and when used with Selenium it can automate and test web applications. Using Python's unittest module, you can write test cases in Selenium. Over the years, Selenium has become a very powerful testing platform and many organizations are adopting Selenium WebDriver for creating automated user interface tests.</p> <p>The book's main aim is to cover the fundamentals related to Python Selenium testing. You will learn how the Selenium WebDriver Python API can be integrated with CI and Build tools to allow tests to be run while building applications. This book will guide you through using the Selenium WebDriver Python client library as well as other tools from the Selenium project. Towards the end of this book, you'll get to grips with Selenium Grid, which is used for running tests in parallel using nodes for cross-browser testing. It will also give you a basic overview of the concepts, while helping you improve your practical testing skills with Python and Selenium.</p>
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...