Selenium IE webdriver 常见的一些问题

问题一: NoSuchWindowException  & Unexpected error launching Internet Explorer. Protected Mode must be set to the same value

解决方案: 进入设置界面并进入Security,将四个模块的“Enable Protected Mode” 都启用或者都禁用。(四个模块的配置必须一致)

Selenium IE webdriver 常见的一些问题_第1张图片

问题二: Selenium.SendKeys() 输入时一个字母接着一个字母输入,速度很慢。

解决方案一: 将64位的IE Webdriver换成32位。(但是这个有时候在64位的操作系统中会出现问题,当用32位的driver,一些web页面的元素可能会无法点击,抛出无法找到该控件的异常,没错,这个就是版本冲突)

补充: 在windows 10 的系统, IE32位和IE64位的浏览器都是安装的。

IE 32 路径: C:\Program Files (x86)\Internet Explorer

IE 64 路径: C:\Program Files\Internet Explorer

解决方案二: 在使用IE Webdriver 64 喂版本时, 可以设置InternetExplorerOptions, 代码如下:

InternetExplorerOptions option = new InternetExplorerOptions();

option.RequireWindowFocus = true;

webDriver = new InternetExplorerDriver(option);

问题三: Unexpected error launching Internet Explorer. Browser zoom level was set to 0%

解决方案: 将IE Zoom设置成100%

你可能感兴趣的:(Selenium IE webdriver 常见的一些问题)