selenium2.0中 InternetExplorerDriver报错问题解决方法
上一篇 /
下一篇 2012-11-26 13:38:16
/ 个人分类:Selenium
org.openqa.selenium.WebDriverException: Unexpected error
launching Internet Explorer. Protected Mode must be set to the same value
(enabled or disabled) for all zones. (WARNING: The server did not provide any
stacktrace
information)51Testing软件测试网jRB| y
页面获取代码没敲错,郁闷了两天,又不想重装系统,从网上搜出了答案,解决方法如下:
;T$b4dLs\'N-l0方法一: 51Testing软件测试网HPgSQ7|J
将test中
l$fZ^(p0复制代码
OjYK t-M0WebDriver
driver = new
InternetExplorerDriver();51Testing软件测试网6e%J+^^H%Uqe;py
51Testing软件测试网#J5W5Hu2N}0W
换成
K+akX+MR;^:J?H0复制代码
v+EfU^1m2?0DesiredCapabilities
ieCapabilities =
DesiredCapabilities.internetExplorer();
ma#Z6JP-AnH0ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
true); 51Testing软件测试网NE/uG r
WebDriver driver = new
InternetExplorerDriver(ieCapabilities);
?"hn^;InV0----------------------这种方法试了无效于是转用第二种方法
2S7M!S.zIB051Testing软件测试网
ik6h0Z-G[gs/`W.mi
51Testing软件测试网*B&G;yvqM
51Testing软件测试网
P6y,~.fH.eU
eQ4H%@
51Testing软件测试网9|Q\|+J \
方法二:
[o$S3]7~ gG4eF0IE安全保护都去掉:
internet选项——安全
kriH3@+h!@0internet-启用保护模式 勾去掉 51Testing软件测试网+O;R9h5`-tuo.v
本地internet-启用保护模式
勾去掉 51Testing软件测试网 _#WWK
A"K8Pr
可信站点-启用保护模式 勾去掉
\VU/~ N\ ~)R0受限站点-启用保护模式
勾去掉
5uR/?5i#~0----------------------觉得烦,直接设为默认,然后保存,运行后OK
收藏
举报
TAG: