1. Open URL:http://tungwaiyip.info/software/HTMLTestRunner.html, download htmltestrunner.py
2.copy its htmltestrunner.py content, under the Python path under the Lib package, new. py suffix name, paste copy content
3. If the Python version is 2.0, the above operation can be imported htmltestrunner, but there are different python3, need to change the following content
(1) In line 94, change import Stringio to import IO
(2) 539 Rows Self.outputbuffer = Stringio.stringio () to be changed to Self.outputbuffer = Io. Bytesio ()
(3) Navigate to line 642, if not Rmap.has_key (CLS): Need to be replaced with if not CLS in Rmap:
(4) 772 line, the UE = E.decode (' latin-1 ') directly to the UE = E.
(5) 766 there are similar UO = O.decode (' latin-1 '), changed to Uo=o;
(6) 768 lines of UO = O, changed directly to UO = O.decode (' Utf-8 ').
(7) 774 there is a similar UE = e, changed to UE = E.decode (' Utf-8 ').
(8) To 631 lines, the print statement is modified, the original is print >>sys.stderr, ' \ntime Elapsed:%s '% (self.stoptime-self.starttime), can be changed to print (' \ Ntime Elapsed:%s '% (self.stoptime-self.starttime), File=sys.stderr)
(9) Locate to 118 lines and change Self.fp.write (s) to Self.fp.write (bytes (s, ' UTF-8 ')).
4. Finish the above operation, after the successful sign:
8, Selenium+python install Htmltestrunner plug-in