Python--selenium a practical method for automatically generating test HTML reports--htmltestrunner

Source: Internet
Author: User


Let us introduce the following the Htmltestrunner module automatically generates test report methods.

    • First we import the UnitTest framework module and automatically generate the registration module Htmltestrunner

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/92/40/wKioL1j9rIPjL3ipAAAItXaBUos277.png-wh_500x0-wm_ 3-wmp_4-s_2397333791.png "title=" import report module. png "alt=" wkiol1j9ripjl3ipaaaitxabuos277.png-wh_50 "/>

    • Write your own function:

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/92/40/wKioL1j9rI7BIgiWAAA6wiFBFfw204.png-wh_500x0-wm_ 3-wmp_4-s_2197187298.png "title=" test function. png "alt=" wkiol1j9ri7bigiwaaa6wifbffw204.png-wh_50 "/>

    • called the Htmltestrunner module runs the use case and automatically generates a test report, set as follows:

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/92/41/wKiom1j9rJzQuMXuAABjaQOSDrI481.png-wh_500x0-wm_ 3-wmp_4-s_14268704.png "title=" Report settings. png "alt=" wkiom1j9rjzqumxuaabjaqosdri481.png-wh_50 "/>

set relevant parameters according to your needs ( Related testing Knowledge exchange QQ Group: 610845268 ).

    • After setting up we run to see the results of the report:

The use cases all pass, and if there are errors there will be a detailed information prompt.

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/92/40/wKioL1j9rLCzRHPSAADmemm_U1c917.png-wh_500x0-wm_ 3-wmp_4-s_1112468674.png "title=" report results. png "alt=" wkiol1j9rlczrhpsaadmemm_u1c917.png-wh_50 "/>

Here a simple test report is done. Specific to the project testing needs to be based on specific circumstances to

Set the relevant parameters, and in case of large projects need to use multi-threading to run.


This article from the "It Bug" blog, declined reprint!

Python--selenium a practical method for automatically generating test HTML reports--htmltestrunner

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.