defnngj / pyautoTest

104 stars 99 forks source link

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

Open liutan102 opened 4 years ago

liutan102 commented 4 years ago

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

Juan-Chen-BNUZ commented 4 years ago

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

karllao commented 3 years ago

@liutan102 有解决了吗

karllao commented 3 years ago

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

lonelyplant commented 1 year ago

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

微信截图_20231012211139