Python2 use Htmltestrunner to generate test reports, there will be garbled language output, the main encoding format is not uniform, change the encoding format on the line.
: http://tungwaiyip.info/software/HTMLTestRunner.html
First, Chinese garbled
1. In the test report, MSG custom exception content is garbled in Chinese, as shown in
Second, modify the code
1. Locate htmltestrunner.py file, search: UO =
2. Find the two places in the Red locale encoding
3. Comment out the red area two settings, re-add the encoding format: UO = O.decode (' utf-8 ') UE = E.decode (' Utf-8 ')
4. After the modification, remember to save, re-run, garbled problem solved
Iii. Python3 Reporting Issues
1.python3 's small partner directly with this: http://tungwaiyip.info/software/HTMLTestRunner.html files, is not directly generated reports, need to be slightly modified
2. The modified source files have been packaged and put into QQ group files: 646645429
Selenium2+python Automatic 68-html report garbled problem