8, Selenium+python install Htmltestrunner plug-in

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.