pyautoTest icon indicating copy to clipboard operation
pyautoTest copied to clipboard

conftest 中的截图功能 有问题,单独运行时报错“AttributeError: 'NoneType' object has no attribute 'save_screenshot'”

Open liutan102 opened this issue 5 years ago • 4 comments

conftest 中的截图功能 有问题,run_test运行时候没有错但是image中没有图片;单独运行 conftest 时报错“AttributeError: 'NoneType' object has no attribute 'save_screenshot'”

liutan102 avatar May 30 '20 07:05 liutan102

new_report_time() 方法中路径错误,return files[-1],当存在日志的时候,倒数第一个文件是__init__.py,所以save_screenshot方法中的路径就会错误,应该改成 return files[-2]

Juan-Chen-BNUZ avatar Jun 22 '20 02:06 Juan-Chen-BNUZ

@liutan102 有解决了吗

karllao avatar Feb 19 '21 06:02 karllao

@Juan-Chen-BNUZ 没理解你的意思

karllao avatar Feb 19 '21 06:02 karllao

我遇到了同样的报错,我发现可能是因为浏览器驱动没有下载成功,注释掉下载浏览器驱动的一行代码后,添加一行 driver = webdriver.Chrome(),手动配置浏览器驱动后再次运行已经正常

微信截图_20231012211139

lonelyplant avatar Oct 12 '23 13:10 lonelyplant