pycharm中使用pytest遇到这个错AttributeError: 'NoneType' object has no attribute 'get_screenshot_as_base64'报错

pycharm中使用pytest遇到这个错误AttributeError: 'NoneType' object has no attribute 'get_screenshot_as_base64'

可能原因:由于代码中写的driver打开浏览器不成功,未对想打开的浏览器中添加相应版本的driver驱动

http://npm.taobao.org/mirrors/chromedriver/   谷歌driver下载

注意:
将文件谷歌浏览器驱动chromedriver.exe放到如下安装目录下:
1.谷歌浏览器安装目录下:比如C:\Users\Administrator\AppData\Local\Google\Chrome\Application(注意添加到环境变量Path下)
2.以及python安装目录下:比如C:\python3.7.1
 

我的由于没有firefoxdriver驱动,换成谷歌的就成功了(注意浏览器首字母是大写),不会报错了

pycharm中使用pytest遇到这个错AttributeError: 'NoneType' object has no attribute 'get_screenshot_as_base64'报错

相关文章:

  • 2022-01-06
  • 2021-07-17
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
  • 2021-06-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2021-11-27
  • 2021-12-23
  • 2022-12-23
  • 2021-09-02
相关资源
相似解决方案