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的更多相关文章

  1. 解决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 ...

  2. 【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 ...

  3. 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 ...

  4. 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设置 将所有区域的保护模式勾选去掉即可

  5. 【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个区域的安全保护模式

  6. 【解决问题】failed: java.lang.RuntimeException: org.openqa.selenium.WebDriverException: Unexpected error launching Internet Explorer.

    failed: java.lang.RuntimeException: org.openqa.selenium.WebDriverException: Unexpected error launchi ...

  7. 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 ...

  8. 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 时总是无法打开对应的百度网址,页面如下所示:

  9. selenium启动IE浏览器报错:Unexpected error launching Internet Explorer. Browser zoom level was set to

    解决此问题的方法就是查看自己的浏览器是否没有放大至100%,如下 如果不是100%就会报错

随机推荐

  1. JUC学习

    JUC是java.util.concurrent包 并发编程的工具包 并发.并行 并发:多线程操作一个资源 并行:多人一起走 并发编程的本质:充分利用cpu的资源 线程的几个状态 新建 运行 堵塞 等 ...

  2. 手把手教你Spring Boot整合Mybatis Plus 代码生成器

    一.在pom.xml中添加所需依赖 <!-- MyBatis-Plus代码生成器--> <dependency> <groupId>com.baomidou< ...

  3. MySQL提权 通过UDF

    目录 UDF是什么 命令执行 文本写入 Example: 远程写入 反弹Shell 提权 UDF是什么 参考:https://www.cnblogs.com/litlife/p/9030673.htm ...

  4. HDOJ-1358(字符串压缩+KMP)

    Period HDOJ-1358 这题还是属于KMP算法的应用,属于字符串压缩问题.也就是在一个字符串s中寻找一个前缀,使得s可以被一份或者多份前缀子串t拷贝连接,也就是串接. #include< ...

  5. Java 虚拟机详解

    深入理解JVM 1   Java技术与Java虚拟机 说起Java,人们首先想到的是Java编程语言,然而事实上,Java是一种技术,它由四方面组成: Java编程语言.Java类文件格式.Java虚 ...

  6. mongoDB导出-导入数据

    --导出数据集 C:\MongoDB\db\bin>mongoexport -d ttx-xwms-test -c things -o d:\mongo_data\things.txt C:\M ...

  7. ElasticSearch 进阶

    目录 ElasticSearch 进阶 SearchAPI 检索信息 Query DSL 基本语法格式 查询-match 查询-match_phrase 查询-multi_match 查询-bool复 ...

  8. FreeBSD 乃至开源界中的孔乙己 再论苦难哲学之一

    在许多狂热的FreeBSD 粉丝里,他们甚至不允许别人把FreeBSD写作freebsd,要和你强调,F和BSD都是大写的.还说这是什么尊重之类的东西.大抵和孔乙己的茴香豆的茴的有四种写法一样吧:&q ...

  9. python stats画正态分布、指数分布、对数正态分布的QQ图

    stats.probplot(grade, dist=stats.norm, plot=plt) #正态分布 # stats.probplot(grade, dist=stats.expon, plo ...

  10. CSS垂直布局

    1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="U ...