首页 > 编程语言 > 详细

selenium+python自动化测试--解决无法启动IE浏览器及报错问题

时间:2019-11-26 12:53:35      阅读:152      评论:0      收藏:0      [点我收藏+]

前言:记录启动IE浏览器的报错及解决方法。

错误1:

selenium.common.exceptions.WebDriverException: Message: ‘IEDriverServer.exe‘ executable needs to be in PATH. Please download from http://selenium-release.storage.googleapis.com/index.html and read up at https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver

Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.ie.service.Service object at 0x000001541A09C1D0>>

 

解决方法:

根据以上报错提示,点击蓝色链接,下载IEDriverServer.exe  ,这里需要注意的是,所下载的IEDriverServer要与selenium版本保持一致!!!

(1)查看selenium版本

打开cmd,输入命令:pip show selenium,可以查看到版本号为2.53.6

技术分享图片

 

 (2)下载IEDriverServer.exe 

点击报错链接或直接在浏览器输入:http://selenium-release.storage.googleapis.com/index.html,根据selenium对应版本进行下载。

技术分享图片

根据需要下载32位或64位

技术分享图片

 将下载完成后的压缩包解压,并将其放置python文件夹下即可。

技术分享图片

 

错误2:

WebDriverException: Message: u‘Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.‘


解决方法:

在IE浏览器的  设置>internet选项>安全 下 ,将四个区域中启用保护模式的勾选状态取消,应用并确定。

技术分享图片

 技术分享图片

 

 错误3:

selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Browser zoom level was set to 150%. It should be set to 100%

 

解决方法:

修改浏览器缩放比例为100%即可。

技术分享图片

 

 

selenium+python自动化测试--解决无法启动IE浏览器及报错问题

原文:https://www.cnblogs.com/yudx/p/11934343.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!