selenium启动IE失败,并报错:Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones
1.selenium去启动IE时,报错:
Started InternetExplorerDriver server (32-bit)
2.50.0.0
Listening on port 24641
Only local connections are allowed
Exception in thread "main" org.openqa.selenium.WebDriverException: 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: 1.17 seconds
2.启动时的代码为:
package com.chrome.test;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class Login_IETest {
public static void main(String[] args) {
// 申明driver对象
System.setProperty("webdriver.ie.driver", "D:\\selenium\\IEDriverServer.exe");
InternetExplorerDriver driver = new InternetExplorerDriver();
// 获取并在浏览器中打开 百度 链接
driver.get("http://www.baidu.com");
// 关闭当前焦点所在的窗口
driver.close();
}
}
解决方法一:
这个是因为IE浏览器: 工具==》Internet选项==》安全 界面下四个区域设置了 “启用保护模式” ,而我们要做的就是 不启用保护模式

方法一:比较简单直接去IE浏览器设置就OK了
解决方法二:
package com.chrome.test;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
public class Login_IETest {
public static void main(String[] args) {
// 申明driver对象
System.setProperty("webdriver.ie.driver", "D:\\selenium\\IEDriverServer.exe");
// IE的常规设置,便于执行自动化测试
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
InternetExplorerDriver driver = new InternetExplorerDriver(ieCapabilities);
// 获取并在浏览器中打开 百度 链接
driver.get("http://www.baidu.com");
// 关闭当前焦点所在的窗口
driver.close();
}
}
方法二:是直接使用加粗的那段代码对IE进行常规设置,方法一和方法二各有其特点,根据自己的需要get吧!
selenium启动IE失败,并报错:Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones的更多相关文章
- 解决selenium 启动ie浏览器报错:Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones
启动ie代码: System.setProperty("webdriver.ie.driver", "bin/IEDriverServer.exe"); Web ...
- 【Python + Selenium】初次用IE浏览器之报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones.
初次用IE浏览器运行自动化程序时,报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launchi ...
- python3+selenium使用浏览器IE的时候,无法打开IE浏览器,老是报错: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones
python3+selenium使用浏览器IE的时候,老是报错: Unexpected error launching Internet Explorer. Protected Mode settin ...
- selenium启动IE浏览器报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode mu
意思是浏览器的保护模式设置不一致所导致 解决方案-->修改IE设置 将所有区域的保护模式勾选去掉即可
- 【Selenium】【BugList6】调用IE,未启用保护模式,报:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones.
>>> driver = webdriver.Ie() 解决方法: 1.打开Ie浏览器 , 工具 ->Internet选项 ->安全 2.去掉4个区域的安全保护模式
- 【解决问题】failed: java.lang.RuntimeException: org.openqa.selenium.WebDriverException: Unexpected error launching Internet Explorer.
failed: java.lang.RuntimeException: org.openqa.selenium.WebDriverException: Unexpected error launchi ...
- selenium2Library报错: Unexpected error launching Internet Explorer. Browser zoom level was set to 119%. It should be set to 100%
Exception in thread "main" org.openqa.selenium.remote.SessionNotFoundException: Unexpected ...
- Selenium2学习-037-WebUI自动化实战实例-IE浏览器显示比例问题:org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Browser zoom level was set to 94%. It should be set to 100%
好久没有写博文了,今天在给部门新人演示 Selenium WebDriver 启动其支持的各种浏览器时,启动 IE 时总是无法打开对应的百度网址,页面如下所示:
- selenium启动IE浏览器报错:Unexpected error launching Internet Explorer. Browser zoom level was set to
解决此问题的方法就是查看自己的浏览器是否没有放大至100%,如下 如果不是100%就会报错
随机推荐
- Windows定时重新启动(适用于server 2012 r2)
直接看链接吧:https://jingyan.baidu.com/article/2d5afd69dd8e9d85a2e28eb7.html 开始菜单,找到"计划任务程序"; 2 ...
- 将VMware虚拟机最小化到托盘栏
版权:本文采用「署名-非商业性使用-相同方式共享 4.0 国际」知识共享许可协议进行许可. 目录 前言 将VMware最小化到托盘栏的方法 1.下载 Trayconizer 2.解压 trayco ...
- DS线段树优化最短路&&01bfs浅谈
1简介 为什么需要?原因很简单,当需要有大量的边去连时,用线段树优化可以直接用点连向区间,或从区间连向点,或从区间连向区间,如果普通连边,复杂度是不可比拟的.下面简单讲解一下线段树(ST)优化建图. ...
- 学习笔记 - 快速傅里叶变换 / 大数A * B的另一种解法
转: 学习笔记 - 快速傅里叶变换 / 大数A * B的另一种解法 文章目录 前言 ~~Fast Fast TLE~~ 一.FFT是什么? 二.FFT可以干什么? 1.多项式乘法 2.大数乘法 三.F ...
- a标签不能继承父级的颜色
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- Java8的新特性--函数式接口
目录 函数式接口 什么是函数式接口 函数式接口的使用 Java8内置的四大核心函数式接口 一.Consumer:消费型接口(void accept(T t)) 二.Supplier:供给型接口(T g ...
- cve-2019-2725 反序列化远程代码执行
描述:部分版本WebLogic中默认包含的wls9_async_response包,为WebLogic Server提供异步通讯服务.由于该WAR包在反序列化处理输入信息时存在缺陷,攻击者可以发送精心 ...
- 爬虫必知必会(3)_requests模块高级
一.爬虫爬取失败的几个原因 1.在短时间内向网站发起了一个高频的请求 解决办法:使用代理 2.连接池(http)中的资源被耗尽 解决办法:立即将请求断开:Connection:close 3.高清图片 ...
- WPF 基础 - 图片之界面截图
1. 功能 系统截图. 2. 实现 2.1 思路 控件继承自 System.Windows.Media.Visual, 通过 System.Windows.Media.Imaging.RenderVi ...
- PyCharm之python package和directory的区别
python作为一门解释性的脚本语言.python中模块就是指一个py文件,如果我们将所有相关的代码都放在一个py文件中,则该py文件既是程序又是是模块,但是程序和模块的设计目的是不同的,程序的目的是 ...