selenium使用IE 浏览器问题
代码如下:
#coding=utf-8
from selenium import webdriver
driver=webdriver.Ie()
driver.get('https://www.baidu.com')
print driver.title
driver.quit()
报错: Traceback (most recent call last):
File "D:\Users\xxxxx\workspace\aautotest\test_ie.py", line 12, in <module>
driver=webdriver.Ie()
File "D:\Python27\lib\site-packages\selenium\webdriver\ie\webdriver.py", line 54, in __init__
desired_capabilities=capabilities)
File "D:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 74, in __init__
self.start_session(desired_capabilities, browser_profile)
File "D:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 123, in start_se
ssion
'desiredCapabilities': desired_capabilities,
File "D:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 175, in execute
self.error_handler.check_response(response)
File "D:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 166, in check
_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer
. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the s
ame value (enabled or disabled) for all zones.
解决办法:把ie的保护模式都选上或都勾掉就可以了:

selenium使用IE 浏览器问题的更多相关文章
- (原创)如何使用selenium 驱动chrome浏览器并且打开方式为手机模式-转载请注明出处
随着移动设备使用率的不断增加,移动页面的测试也变得越来越重要. 对于互联网公司M站的测试,如果不通过专用的appium等移动端测试工具是否还有方便快捷的办法呢?答案当然是有啊. 使用chrome dr ...
- selenium + python 多浏览器测试
selenium + python 多浏览器测试 支持库包 在学习 Python + Selenium 正篇之前,先来看下对多浏览器模拟的支持.目前selenium包中已包含webdriver,hel ...
- Selenium IDE- 不同的浏览器
Selenium IDE- 不同的浏览器 Selenium IDE脚本只能对火狐的工具Firefox插件运行测试.使用Selenium-IDE开发的测试可以对其他浏览器所保存为Selenium网络驱动 ...
- selenium 启动ie 浏览器
selenium 启动ie 浏览器 var driver = new InternetExplorerDriver(@"IEDriverServer.exe路径"); driver ...
- Selenium Grid跨浏览器-兼容性测试
Selenium Grid跨浏览器-兼容性测试 这里有两台机子,打算这样演示: 一台机子启动一个作为主点节的hub 和 一个作为次节点的hub(系统windows 浏览器为ie) ip为:192.16 ...
- selenium+谷歌无头浏览器爬取网易新闻国内板块
网页分析 首先来看下要爬取的网站的页面 查看网页源代码:你会发现它是由js动态加载显示的 所以采用selenium+谷歌无头浏览器来爬取它 1 加载网站,并拖动到底,发现其还有个加载更多 2 模拟点击 ...
- selenium与chrome浏览器及驱动的版本匹配
用selenium+python+webdriver完成UI功能自动化,经常会碰到浏览器版本与驱动的版本不匹配而引起报错,下面就selenium与chrome浏览器及驱动的版本匹配 做个总结. 使用W ...
- selenium自动化打开浏览器不受信任解决办法
之前在用selenium(火狐浏览器)打开一个https网站时,总是弹出不受信任,修改配置后,每次加载的浏览器都是还原了配置,无法加载出页面,这里给出解决办法:让浏览器去加载我们修改后的配置,具体如下 ...
- selenium WebDriver 对浏览器标签页的切换
关于selenium WebDriver 对浏览器标签页的切换,现在的市面上最新的浏览器,当点击一个链接打开一个新的页面都是在浏览器中打开一个标签页,而selenium只能对窗口进行切换的方法,只能操 ...
- Python selenium + Firefox启动浏览器
Python selenium 的运用 from selenium import webdriver # from selenium.webdriver.firefox.firefox_profile ...
随机推荐
- RECT 数据结构
数据结构RECT定义了一个矩形的左上角和右下角的坐标 ? 1 2 3 4 5 6 7 8 typedef struct _RECT{ LONG left; LONG t ...
- Win 2003下IIS6+Mysql+php5.2 isapi搭建 升级php5.2到5.3测试 借助fastcgi实现
Win 2003下IIS6+Mysql+php5.2 原环境isapi搭建 升级php5.2到5.3测试 借助fastcgi实现 操作如下 实验前准备:php-5.3.5-Win32-VC6-x86 ...
- phpQuery采集微信公众号文章乱码
终于找到解决方案了,这是一个值得庆祝的事情.... 原来是因为微信在源码中加入了防采集代码<!--headTrap<body></body><head>< ...
- php读取excel文件 更新修改excel
php读取excel文件示例,还有更新修改功能. 代码: //模板存放目录 $dir = $DOCUMENT_ROOT.'/backoffice/admin/oemcheck/'; $template ...
- mouseout以及mouseover
两个图层 红色图层代表outside蓝色图层代表inside dom结构如下 <div id="outside"> <div id="insi ...
- 编写测试类,了解ArrayList的方法
这篇文章主要介绍了C#中动态数组用法,实例分析了C#中ArrayList实现动态数组的技巧,非常具有实用价值,需要的朋友可以参考下 本文实例讲述了C#中动态数组用法.分享给大家供大家参考.具体分析如下 ...
- UCOS2_STM32F1移植详细过程(一)
Ⅰ.概述 该文写针对初学µC/OS的朋友,基于以下平台来一步一步移植µC/OS嵌入式操作系统.UCOS移植相关平台: 系统平台:µC/OS-II (最新V2.92版) 硬件平台:STM32F1 ...
- ios 工程图片清理shell
#!/bin/shecho "随意删除@2x图片可能会引起错误 因为ios工程会更加前缀和分辨率自己找到@2x的图片 所以删除@2x图片时要慎重"read -n1 -p &quo ...
- Python 有哪些优点?为何要学Python?
1. 支持OOP编程 从根本上讲Python仍是一种面向对象的语言,支持多态.继承等高级概念,在Python里使用OOP十分容易 没有C++.Java那样复杂,但不必做Python下OOp高手,够 ...
- hdu 1269 迷宫城堡
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=1269 迷宫城堡 Description 为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个 ...