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软件测试网 p{R4Ek,I
页面获取代码没敲错,郁闷了两天,又不想重装系统,从网上搜出了答案,解决方法如下:
QC t\Mw0方法一:
uv%aH!q,U-C}/q'Ki0将test中
{-T)T'v1F\0复制代码
A1_&A%j4A0WebDriver
driver = new
InternetExplorerDriver();
s?}HJ.c3q8X'bO,G0
J3~8xZL^jV6T4}0换成 51Testing软件测试网Yu ]e \-`A n^A
复制代码51Testing软件测试网h
dx-[EU5g
DesiredCapabilities
ieCapabilities =
DesiredCapabilities.internetExplorer(); 51Testing软件测试网4r4GqQ J
\W%?d
ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
true); 51Testing软件测试网Y)O9J ig4K5Qf%l~
WebDriver driver = new
InternetExplorerDriver(ieCapabilities);51Testing软件测试网#p
w$}R8b/a]9bRr
----------------------这种方法试了无效于是转用第二种方法
-sGmGwL$H#@5A6[B0
r2\p5bh%\ l051Testing软件测试网,y1i"AlU-?N#M]V
%jC!N u;g xU/@ m0
`[Fm2J0方法二:
;l#x v8x_R(Wz"?0IE安全保护都去掉:
internet选项——安全
(pi1?Y-c4c0internet-启用保护模式 勾去掉
m.j%U(e:^)j,aUtu0本地internet-启用保护模式
勾去掉 51Testing软件测试网2Jb6U:ft!n
可信站点-启用保护模式 勾去掉 51Testing软件测试网XLL4W^C
受限站点-启用保护模式
勾去掉 51Testing软件测试网4Y-^xw3M+}[
----------------------觉得烦,直接设为默认,然后保存,运行后OK
收藏
举报
TAG: