Selenium常见问题
2024.12.04
在Pycharm中运行Selenium+Pytest测试程序时不能启动火狐浏览器,有时报空套件错误。可能是软件版本引起的,也可能是与其他软件冲突导致的。出现问题所用的软件版本如下:
Python 3.12.3,Selenium 4.27.0,Pytest 8.3.3
在Pycharm中可以删除虚拟环境,重新创建虚拟环境。在Pycharm终端安装Selenium 4.27.1,Pytest 8.3.4。问题消失。
用如下的命令安装指定版本的软件:
pip install selenium==4.27.1
在Windows命令窗口安装的软件属于全局环境,在Pycharm中创建的虚拟环境属于项目的局部环境,在Pycharm终端安装的软件属于虚拟环境。创建虚拟环境时可以选择继承全局环境。
2024.12.02
火狐浏览器与驱动的版本
{"geckodriver-releases": [{"geckodriver-version": "0.35.0","min-firefox-version": 115},{"geckodriver-version": "0.34.0","min-firefox-version": 115},{"geckodriver-version": "0.33.0","min-firefox-version": 102,"max-firefox-version": 120},{"geckodriver-version": "0.32.2","min-firefox-version": 102,"max-firefox-version": 120},{"geckodriver-version": "0.32.1","min-firefox-version": 102,"max-firefox-version": 120},{"geckodriver-version": "0.32.0","min-firefox-version": 102,"max-firefox-version": 120},{"geckodriver-version": "0.31.0","min-firefox-version": 91,"max-firefox-version": 120},{"geckodriver-version": "0.30.0","min-firefox-version": 78,"max-firefox-version": 90},{"geckodriver-version": "0.29.1","min-firefox-version": 60,"max-firefox-version": 90},{"geckodriver-version": "0.29.0","min-firefox-version": 60,"max-firefox-version": 90},{"geckodriver-version": "0.28.0","min-firefox-version": 60,"max-firefox-version": 90},{"geckodriver-version": "0.27.0","min-firefox-version": 60,"max-firefox-version": 90},{"geckodriver-version": "0.26.0","min-firefox-version": 60,"max-firefox-version": 90},{"geckodriver-version": "0.25.0","min-firefox-version": 57,"max-firefox-version": 90},{"geckodriver-version": "0.24.0","min-firefox-version": 57,"max-firefox-version": 79},{"geckodriver-version": "0.23.0","min-firefox-version": 57,"max-firefox-version": 79},{"geckodriver-version": "0.22.0","min-firefox-version": 57,"max-firefox-version": 79},{"geckodriver-version": "0.21.0","min-firefox-version": 57,"max-firefox-version": 79},{"geckodriver-version": "0.20.1","min-firefox-version": 55,"max-firefox-version": 62},{"geckodriver-version": "0.20.0","min-firefox-version": 55,"max-firefox-version": 62},{"geckodriver-version": "0.19.1","min-firefox-version": 55,"max-firefox-version": 62},{"geckodriver-version": "0.19.0","min-firefox-version": 55,"max-firefox-version": 62},{"geckodriver-version": "0.18.0","min-firefox-version": 53,"max-firefox-version": 62},{"geckodriver-version": "0.17.0","min-firefox-version": 52,"max-firefox-version": 62}] }