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. 工作之余第二篇(看源码自己实现ArrayList和LinkList)

    先看源码: 首先看构造器,构造器有三种,一种直接给定初始长度的,如下代码 public ArrayList(int initialCapacity) { if (initialCapacity > ...

  2. 后端程序员之路 42、Semaphore

    前面学习了Pthreads,了解了线程和线程同步,而同步这个东西,与信号量是密不可分的.下面讨论的主要是Pthreads里的semaphore.h,而不是sys/sem.h [Linux]线程同步之信 ...

  3. CTF-杂项笔记

                01 赛题解答 (1)目标:了解modbus协议 (2)解题: 密文:666C61677B4533334237464438413342383431434139363939454 ...

  4. CSV 注入实战

    oxo1 前言 之前看到过 CSV 注入的文章,具体想了解的请搜索学习,这里不多作介绍.今天刚好碰到了导出功能,就随手测试一波,没想到还真的存在 CSV 注入漏洞. oxo2 经过 1.测试漏洞 看到 ...

  5. 漫漫Java路1—基础知识—初涉java

    前言 主学信息安全,在编程的路上还是一个孩子,还在一步一步探索,有些东西可能是站在自己的位置思考的,很可能会出现一些啼笑皆非的错误,如果有误,还希望各位斧正. Java安装 jdk的安装 甲骨文官网选 ...

  6. 【海思】Hi3516A 运行sample_venc的demo内核奔溃(DDR问题)

    作者:李春港 出处:https://www.cnblogs.com/lcgbk/p/14514297.html 目录 一.前言 二.使用memtester对ddr进行压力测试 三.修改uboot的DD ...

  7. 利用kali系统制作最简单的OS

    制作最简单的OS 一.生成.bin文件 1.创建Boot.asm文件,输入相应的汇编代码 org 07c00h ; mov ax, cs mov ds, ax mov es, ax call Disp ...

  8. mongodb为什么比mysql效率高

    首先是内存映射机制,数据不是持久化到存储设备中的,而是暂时存储在内存中,这就提高了在IO上效率以及操作系统对存储介质之间的性能损耗.(毕竟内存读取最快) 其次,NoSQL并不是不使用sql,只是不使用 ...

  9. The 2018 ACM-ICPC CCPC NING XIA G-Factories

    题意:在一棵数的叶子上建k个工厂保证,求两两距离之和的最小值. 思路:如果一个一个叶子节点去考虑去与否太麻烦了,直接考虑该节点的子树上选取几个作为工厂,利用树形DP,dp[u][i]表示的是u节点为根 ...

  10. python学习8 文件的操作

    本文拷贝了on testing 的<python之文件操作:文件的读写>,只做学习之用 python的文件读写通过 一.用open函数 二.对文件读写操作 三.读取文件位置定位 1. op ...