自动化测试 - HTMLTestRunner生成测试报告
记录HTMLTestRunner生成自动化测试报告的学习心得
WenBeacon
这个作者很懒,什么都没留下…
展开
-
接口自动化测试时报:JSON parse error
1.报错信息,如下{ "title" : "Bad Request", "status" : 400, "detail" : "JSON parse error: Unrecognized token 'username': was expecting ('true', 'false' or 'null'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'usern...原创 2021-06-24 16:39:57 · 5816 阅读 · 0 评论 -
python输出测试报告时,报AttributeError: ‘_TestResult‘ object has no attribute ‘outputBuffer‘
1.报错信息:AttributeError: '_TestResult' object has no attribute 'outputBuffer'原创 2021-06-08 11:31:12 · 2230 阅读 · 0 评论 -
python读取Excel单元格数据时cell(rowx, colx)和cell_value(rowx, colx)的区别
一、源码分析:def cell(self, rowx, colx): """ :class:`Cell` object in the given row and column. """ if self.formatting_info: xfx = self.cell_xf_index(rowx, colx) else: xfx = None return Cell( self._cell_types[r.原创 2021-05-06 17:17:42 · 17758 阅读 · 1 评论 -
生成html格式的测试报告时,报【TypeError: a bytes-like object is required, not ‘str‘】
一,报错信息E:\pythonProject\study\venv\Scripts\python.exe E:/pythonProject/case/test_login.py...Traceback (most recent call last): File "E:\pythonProject\case\test_login.py", line 71, in <module> runner.run(suit) # 调用HTMLTestRunner类下面的run()方法运行用...原创 2021-04-28 15:43:52 · 1031 阅读 · 1 评论 -
使用HTMLTestRunner生成html格式的测试报告,中文乱码的解决方法
注意:文件格式一:查看html测试报告,如下图:二:部分源码filename = "E:/pythonProject/report/login_report.html" # 测试报告的存放路径及文件名fp = open(filename, "w") # 创建HTML格式的测试报告文件,此时还是个空文件,可用于写入文本runner = HTMLTestRunner.HTMLTestRunner(stream=fp,原创 2021-04-28 15:26:56 · 509 阅读 · 1 评论 -
生成自动化测试报告时报错,如何解决?
提问:AttributeError: 'str' object has no attribute 'write'1.问题描述:使用HTMLTestRunner方法生成html类型的测试报告时报错,如下图2.测试源码:# coding:utf-8import unittest, osfrom forTest import *from HTMLTestRunner import HTMLTestRunner# 会生成一个report.html格式的文件,在使用前进行路径的设置(保存原创 2020-11-17 17:22:48 · 419 阅读 · 2 评论