不要运行explorer

Running tests in IE is quite easy. Internet Explorer can’t be launched directly, we have to communicate with the Internet Explorer through Internet Explorer driver.

在IE中运行测试非常容易。 Internet Explorer无法直接启动,我们必须通过Internet Explorer驱动程序与Internet Explorer进行通信。

Internet Explorer驱动程序服务器 (Internet Explorer Driver Server)

Internet Explorer Driver Server is the link between your selenium tests and the Internet Explorer browser. As selenium WebDriver has no native implementation of IE, we have to address all the driver commands through IE driver server.

Internet Explorer驱动程序服务器是您的Selenium测试和Internet Explorer浏览器之间的链接。 由于Selenium WebDriver没有IE的本机实现,因此我们必须通过IE驱动程序服务器解决所有驱动程序命令。

下载并安装Internet Explorer驱动程序 (Download and Install Internet Explorer Driver)

IE driver server is an executable file that needs to have in one of the system paths before running your tests. The following are the steps to download Internet Explorer Driver.

IE驱动程序服务器是一个可执行文件,在运行测试之前,该文件需要包含在系统路径之一中。 以下是下载Internet Explorer驱动程序的步骤。

  • Step 1: Go to the Selenium official website and select appropriate version for Internet Explorer driver based on your operating system步骤1 :转到Selenium官方网站,然后根据您的操作系统为Internet Explorer驱动程序选择适当的版本。
  • Note: Here we are working on Windows Operating system, we need to download the corresponding IE driver of Windows version. If your Operating System is Linux or Mac then you need to download the latest release of Internet Explorer driver which is compatible with your test environment.

    注意:此处我们正在Windows操作系统上工作,我们需要下载Windows版本的相应IE驱动程序。 如果您的操作系统是Linux或Mac,则需要下载与您的测试环境兼容的Internet Explorer驱动程序的最新版本。

    IE Driver Server

    IE驱动程序服务器

  • Step 2: Once the ZIP file download is complete, extract the ZIP file and keep it somewhere on a known location on your system.步骤2 :ZIP文件下载完成后,解压缩ZIP文件并将其保存在系统上的某个已知位置。
  • 使用IE时要记住的要点 (Points to remember when working with IE)

  • Zoom level should set to 100%缩放比例应设置为100%
  • Protected mode should be turned off and make a level to least positions ie to bottom down position.保护模式应关闭,并将水平调至最低位置,即向下至最低位置。
  • When we run Selenium WebDriver Script in Internet Explorer browser, we may fail to launch IE driver using Selenium WebDriver. Below are the two errors users may face when we run Selenium WebDriver Scripts in IE browser when we won’t set above two points.

    在Internet Explorer浏览器中运行Selenium WebDriver脚本时,我们可能无法使用Selenium WebDriver启动IE驱动程序。 以下是我们在IE浏览器中没有设置以上两点时运行Selenium WebDriver脚本时用户可能会遇到的两个错误。

    使用Selenium WebDriver无法启动IE驱动程序 (Failed to Launch IE Driver using Selenium WebDriver)

    Sometimes many of the Selenium WebDriver users failed to launch IE driver using Selenium WebDriver. To get rid of the common issues here are the solutions most of the users might have faced.

    有时,许多Selenium WebDriver用户无法使用Selenium WebDriver启动IE驱动程序。 要摆脱常见问题,这里是大多数用户可能面临的解决方案。

    错误1: (Error 1:)

    Exception in thread “main” org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. In IE browser Protected Mode settings are not the same for all zones. Protected Mode must be set to the same value for all zones.

    线程“主”中的异常org.openqa.selenium.remote.SessionNotFoundException:启动Internet Explorer发生意外错误。 在IE浏览器中,并非所有区域的保护模式设置都相同。 所有区域的保护模式必须设置为相同的值。

    Solution: To fix the error, we need to enable protected mode for all zones and mode should be turned off and make a level to least positions i.e to bottom down position.

    解决方案:要纠正该错误,我们需要为所有区域启用保护模式,并且应该关闭该模式,并将级别降至最低位置,即向下至最低位置。

    Below are the steps to enable protected mode for all zones.

    以下是为所有区域启用保护模式的步骤。

  • Step 1: Open Internet Explorer步骤1:打开Internet Explorer
  • Step 2: Go toTools menu – Internet Options步骤2:进入“ 工具”菜单-“ Internet选项”
  • Internet Options

    互联网选项

  • Step 3: Select Security Tab步骤3:选择“ 安全性”选项卡
  • Security

    安全

  • Step 4: In Select a zone to view or change security settings choose Internet and select the check box of Enable protected mode (requires restarting Internet Explorer).步骤4:在“ 选择要查看或更改安全设置的区域”中,选择“ Internet”,然后选中“ 启用保护模式 ”复选框(需要重新启动Internet Explorer)。
  • Internet

    互联网

  • Step 5: Similarly, select the check box of Enable protected mode (requires restarting Internet Explorer) for other three such as Local Intranet, Trusted sites, and Restricted sites.步骤5:同样,选中其他三个诸如本地Intranet,受信任的站点和受限制的站点启用保护模式 (需要重新启动Internet Explorer)复选框
  • Local Intranet

    本地内部网

    错误2: (Error 2:)

    Exception in thread “main” org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Browser zoom level was set to 200%. It should be set to 100%

    线程“主”中的异常org.openqa.selenium.remote.SessionNotFoundException:启动Internet Explorer发生意外错误。 浏览器缩放级别设置为200%。 应该设置为100%

    Solution: To fix the error, we need to set the Zoom level to 100% of Internet Explorer browser.

    解决方案:要解决该错误,我们需要将“缩放”级别设置为Internet Explorer浏览器的100%。

    Below are the steps to set the Zoom level to 100%.

    以下是将缩放级别设置为100%的步骤。

  • Step 1: Open Internet Explorer步骤1:打开Internet Explorer
  • Step 2: Go toTools menu – View – Zoom – Select 100%步骤2:进入“ 工具”菜单-“ 视图”-“缩放”-选择100%
  • Zoom

    放大

    使用Selenium WebDriver启动IE浏览器 (Launching IE browser using Selenium WebDriver)

    设置webdriver.ie.driver属性 (Setting up the webdriver.ie.driver property)

    Selenium WebDriver has a class called InternetExplorerDriver that is used to launch and control IE browser. The code to launch IE Driver is exactly the same as if you were launching a FirefoxDriver or ChromeDriver. All we need to Set a system property “webdriver.ie.driver” to the path of executable file “IEDriverServer.exe“. If you miss this, you will face an error “The path to the driver executable must be set by the webdriver.ie.driver system property“.

    Selenium WebDriver有一个称为InternetExplorerDriver的类,用于启动和控制IE浏览器。 启动IE驱动程序的代码与启动FirefoxDriver或ChromeDriver完全相同。 我们需要将一个系统属性“ webdriver.ie.driver ”设置为可执行文件“ IEDriverServer.exe ”的路径。 如果您错过了,您将遇到一个错误“ 驱动程序可执行文件的路径必须由webdriver.ie.driver系统属性设置 ”。

    
    package com.journaldev.selenium.InternetExplorer;import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.ie.InternetExplorerDriver;public class LaunchingIE {public static void main(String[] args) {System.setproperty("Webdriver.ie.driver","D:\\Drivers\\IEDriverServer.exe");WebDriver driver = new InternetExplorerDriver();driver.get("https://journaldev.com");String PageTitle = driver.getTitle();System.out.println("Page Title is:" + PageTitle);driver.close();}}
    

    When you run the above program you will notice that Journaldev.com is opened in the new Internet Explorer window and it will print the website title in the console.

    当您运行上述程序时,您会注意到在新的Internet Explorer窗口中打开Journaldev.com,它将在控制台中打印网站标题。

    翻译自: https://www.journaldev.com/26770/running-test-on-internet-explorer-browser

    不要运行explorer

不要运行explorer_在Internet Explorer浏览器上运行测试相关推荐

  1. 如何使用BHO定制你的Internet Explorer浏览器

    原文出处:Browser Helper Objects: The Browser the Way You Want It 一.简介 有时,你可能需要一个定制版本的浏览器.在这种情况下,你可以自由地把一 ...

  2. 【电脑运用及修理】Internet Explorer 浏览器

    Internet Explorer 浏览器 Internet Explorer 浏览器,简称 IE 浏览器,是微软公司(Microsoft)发布的一款免费的 web 浏览器. Internet Exp ...

  3. IE编程精选-如何使用BHO定制你的Internet Explorer浏览器

    IE编程精选 摘自: http://www.learnsky.com/bbs/printpage.asp?BoardID=6&ID=1002 如何使用BHO定制你的Internet Explo ...

  4. 桌面程序explorer_备份Internet Explorer 7搜索提供程序列表

    桌面程序explorer If you are both an IE user and a fan of using custom search providers in your search bo ...

  5. Windows 技术篇-安装指定版本Internet Explorer浏览器方法,IE浏览器的升级和降级

    首先你需要知道指定版本的补丁.比如 11.0.145 是 KB4516045.如果你要的版本低就卸载补丁.如果要的版本高就安装新的补丁. ie 大版本和小版本降级: 卸载对应的更新补丁,可以进行降级, ...

  6. “您的Microsoft Internet Explorer浏览器包含最新版本的内置Adobe Flash Player“解决

    因为win8.win10以后flash是内置在浏览器的,如果一定要另外安装adobe flash activeX版本的软件,会报如下的错误,因为IE.Microsoft Edge浏览器都是用的acti ...

  7. Windows 技术篇-Internet Explorer浏览器启用方法,windows找不到ie浏览器解决办法

    先全称搜索下,光搜 ie 有时出不来,如果没有的话再看我们的下一步启用. 系统默认的时候一定会带一个版本的,所有没有的话就是我们把ie的功能给关了,我们启用下就好了. 启用方法: 喜欢的点个赞❤吧!

  8. Mac上测试Internet Explorer的N种方法

    Internet Explorer及其升级的版本Edge浏览器仅在Windows计算机上运行.如果您拥有Mac设备,并且想在Internet Explorer或Edge上对网站执行跨浏览器测试,那么真 ...

  9. 怎样不显示限制网页运行可访问计算机的脚本和active控件,Internet Explorer已限制此网页运行脚本或ActiveX控件...

    Internet Explorer已限制此网页运行脚本或ActiveX控件是控件安装错误造成的,解决方法为: 1.先关闭 Internet Explorer 浏览器,然后从开始菜单中找到 Intern ...

最新文章

  1. 阿里一面 京东一面+二面 | 掘金技术征文
  2. 使用Spring Boot和RxJava的构建响应式REST API
  3. mongodb php 报错,PHP5 mongodb 切换db报错 Authentication failed on database admin-汗血宝马
  4. 互联网1分钟 |1129
  5. linux lvm 调整分区大小,linux调整lvm分区大小(/home分区过大,/root分区过小)
  6. 在centos7上设置swap交换空间
  7. 9.广义霍夫变换——广义霍夫变换算法和识别中的应用、现在的霍夫算法及识别中的应用_2
  8. 接口测试--apipost在json中如何使用mock变量
  9. Java教程:Java定义字符串(2种方式)
  10. 强化学习 ---baselines项目之 Atari游戏的网络结构解析
  11. 测试 —— 与开发双手互搏的艺术
  12. 如何配置Mac OS X实现LAN唤醒?
  13. 华为s5720默认用户名和密码_华为华为交换机的默认用户名和密码是多少?谢谢!...
  14. 微信小程序(十二)uni-app框架开发及组件库
  15. 重装windows10系统的教程
  16. ecshop分销说明
  17. Hive 中的时间加减暨间隔函数INTERVAL
  18. 雅马哈机器人编程讲解_雅马哈机器人RCX编程手册
  19. 低分辨率人脸识别(LRFR)相关文章整理——(待更)
  20. vsCode格式化标签属性不换行

热门文章

  1. 构造函数和方法的区别
  2. [转载] python的next()函数
  3. [转载] OpenCV-Python图像位与运算bitwise_and函数详解
  4. 【iOS开发】使用iFrameExtractor实现视频直播
  5. Which language is best, C, C++, Python or Java?什么编程语言最好
  6. SQL语句的解析过程
  7. DP-代理模式(Proxy Pattern)
  8. python---之打印日志logging
  9. CV学习笔记-图像滤波器
  10. 炼丹手册——NaN值问题