Python+selenium自动化测试——启动谷歌浏览器闪退问题 Traceback (most recent call last)

后台报错:Traceback (most recent call last)

当我们使用Python+selenium调用谷歌浏览器出现闪退问题时,其实是谷歌的驱动和浏览器的版本不一致。

Python+selenium自动化测试——启动谷歌浏览器闪退问题 Traceback (most recent call last)_第1张图片

from time import sleep

from selenium import webdriver

driver=webdriver.Chrome()

 1.下载谷歌浏览器驱动=浏览器版本——对应上

http://chromedriver.storage.googleapis.com/index.html

 2.将下载过的谷歌浏览器驱动放在python同一级别的目录上

Python+selenium自动化测试——启动谷歌浏览器闪退问题 Traceback (most recent call last)_第2张图片

3.再次运行程序。谷歌浏览器调用成功。

你可能感兴趣的:(WEB自动化测试,selenium,测试工具)