In learning Python Selenium automated test learning encountered Htmltestrunner test report garbled problem
Test Group/test Case |
Count |
Pass |
Fail |
Error |
View |
Baidu. Baidu |
1 |
1 |
0 |
0 |
Detail |
Test_baidu_search: Baidu Search |
Pass [x] pt1.1: [Error]: ' C:\\users\\zhengb~1\\appdata\\local\\temp\\tmpmoado1\\addoninstaller\\log.txt ' |
Login_verification.oa |
2 |
2 |
0 |
0 |
Detail |
Test_login: Login Verification |
Pass [x] pt2.1:å?? Ç?²æ?? Ç?» Ž?æ?? Å?? ϼ? [Error]: ' C:\\users\\zhengb~1\\appdata\\local\\temp\\tmpbcuhbi\\addoninstaller\\log.txt ' |
Find a solution to the Htmltestrunner test report on the Internet:
(1) Open the htmltestrunner.py source file and locate the following line
From stdout and stderr? If Isinstance (o,str): problem with ' string_escape ': it escape \ n and mess up formating # UO = Unicode (o.encode (' String_escape ')) UO = O.decode (' latin-1 ') else: UO = o if Isinstance (e,str): # Todo:some problem with ' string_escape ': it escape \ n and mess up format ing # UE = Unicode (E.encode (' String_escape ')) UE = E.decode (' latin-1 ') else: UE = E
(2) Add Utf-8 decoding
From stdout and stderr? If Isinstance (o,str): problem with ' string_escape ': it escape \ n and mess up formating # UO = Unicode (o.encode (' String_escape ')) #uo = O.decode (' latin-1 ') UO = O.decode (' utf-8 ') else: UO = o if Isinstance (e,str): # Todo:some problem with ' string_escape ': it escape \ n and mess up formating # UE = Unicode (E.encode (' String_escape ')) #ue = E.decode (' latin-1 ') UE = E.decode (' utf-8 ') else: UE = e
Htmltestrunner Test Report Chinese garbled problem solving