Skip to content
Advertisement

How to generate a test report in python using selenium and unittest?

I was trying to test a simple login form with different cases. I used python,selenium,python’s unittest library for testing and i am able to get test done by unittest library but how can i generate test reports for this ? I tried with HTMLTestRunner but it has bugs and i found it was written for python 2x version. A lot of libraries we not updated to python 3x. How can i generate report for following (to not make it look ugly i just posted two cases): My_code.py

JavaScript

It’s test output:

JavaScript

Advertisement

Answer

Did you try by installing htmltestrunner for python3. Use below command to install:

pip install HTMLTestRunner-Python3

You can see update here: https://pypi.org/project/HTMLTestRunner-Python3/0.8.0/

Also , i presume you have removed code to generate html report from above. I am putting for reference purpose:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement