在用WebDriver中打开Internet Explorer访问百度的是,报下面错误:
org.openqa.selenium.remote.SessionNotFoundException: 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. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 9.00 seconds
Build info: version: '2.37.0', revision: 'a7c61cb', time: '2013-10-18 17:15:02'
System info: host: 'zxy-PC', ip: '10.45.28.133', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_41'
Driver info: driver.version: InternetExplorerDriver
解决办法:
IE安全保护都去掉:
Internet选项—>安全
internet-启用保护模式 勾去掉
本地Intranet-启用保护模式 勾去掉
受信任的站点-启用保护模式 勾去掉
受限制的站点-启用保护模式 勾去掉