生成测试报告时遇到问题TypeError: a bytes-like object is required, not ‘str‘ 场景:使用python做自动化测试,用HTMLTestRunner生成自动化测试报告。
BeautifulReport的两种截图 1、关键步骤截图,任意部位截图class Test(unittest.TestCase): # 定义一个保存截图函数 def save_img(self, img_name): self.browser.get_screenshot_as_file('{}/{}.png'.format(os.path.abspath(r"图片存放路径"), img_name))调用:@BeautifulReport.add_test_img('步骤1截图','步骤2截图',
selenium4降级为selenium3 “find_element_by_* commands are deprecated. Please use find_element() instead”针对selenium4弃用find_element_by_* ,改用find_element(),用的实在不习惯,如果还用find_element_by_*会出现一条横杠。1、可以先看一下现在的selenium版本:pip show selnium2、卸载当前的selenium:pip uninstall selenium3、..