https://code.google.com/p/selenium/wiki/InternetExplorerDriver#Internet_Explorer_Driver
WebDriver
Internet Explorer Driver
The InternetExplorerDriver is a standalone server which implements WebDriver's wire protocol. This driver has been tested with IE 6, 7, 8, 9, and 10 on appropriate combinations of XP, Vista and Windows 7.
The driver supports running 32-bit and 64-bit versions of the browser. The choice of how to determine which "bit-ness" to use in launching the browser depends on which version of the IEDriverServer.exe is launched. If the 32-bit version of IEDriverServer.exe is launched, the 32-bit version of IE will be launched. Similarly, if the 64-bit version of IEDriverServer.exe is launched, the 64-bit version of IE will be launched.
Installing
You do not need to run an installer before using the InternetExplorerDriver, though some configuration is required. The standalone server executable must be downloaded from the Downloads page and placed in your PATH.
Pros
- Runs in a real browser and supports Javascript
Cons
- Obviously the InternetExplorerDriver will only work on Windows!
- Comparatively slow (though still pretty snappy :)
Command-Line Switches
As a standalone executable, the behavior of the IE driver can be modified through various command-line arguments. To set the value of these command-line arguments, you should consult the documentation for the language binding you are using. The command line switches supported are described in the table below. All -<switch>, --<switch> and /<switch> are supported.
Switch | Meaning |
--port=<portNumber> | Specifies the port on which the HTTP server of the IE driver will listen for commands from language bindings. Defaults to 5555. |
--host=<hostAdapterIPAddress> | Specifies the IP address of the host adapter on which the HTTP server of the IE driver will listen for commands from language bindings. Defaults to 127.0.0.1. |
--log-level=<logLevel> | Specifies the level at which logging messages are output. Valid values are FATAL, ERROR, WARN, INFO, DEBUG, and TRACE. Defaults to FATAL. |
--log-file=<logFile> | Specifies the full path and file name of the log file. Defaults to stdout. |
--extract-path=<path> | Specifies the full path to the directory used to extract supporting files used by the server. Defaults to the TEMP directory if not specified. |
--silent | Suppresses diagnostic output when the server is started. |
Important System Properties
The following system properties (read using System.getProperty() and set using System.setProperty() in Java code or the "-DpropertyName=value" command line flag) are used by the InternetExplorerDriver:
Property | What it means |
webdriver.ie.driver | The location of the IE driver binary. |
webdriver.ie.driver.host | Specifies the IP address of the host adapter on which the IE driver will listen. |
webdriver.ie.driver.loglevel | Specifies the level at which logging messages are output. Valid values are FATAL, ERROR, WARN, INFO, DEBUG, and TRACE. Defaults to FATAL. |
webdriver.ie.driver.logfile | Specifies the full path and file name of the log file. |
webdriver.ie.driver.silent | Suppresses diagnostic output when the IE driver is started. |
webdriver.ie.driver.extractpath | Specifies the full path to the directory used to extract supporting files used by the server. Defaults to the TEMP directory if not specified. |
Required Configuration
- The IEDriverServer exectuable must be downloaded and placed in your PATH.
- On IE 7 or higher on Windows Vista or Windows 7, you must set the Protected Mode settings for each zone to be the same value. The value can be on or off, as long as it is the same for every zone. To set the Protected Mode settings, choose "Internet Options..." from the Tools menu, and click on the Security tab. For each zone, there will be a check box at the bottom of the tab labeled "Enable Protected Mode".
- Additionally, "Enhanced Protected Mode" must be disabled for IE 10 and higher. This option is found in the Advanced tab of the Internet Options dialog.
- The browser zoom level must be set to 100% so that the native mouse events can be set to the correct coordinates.
- For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates. For 32-bit Windows installations, the key you must examine in the registry editor isHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE. For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE. Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.
Native Events and Internet Explorer
As the InternetExplorerDriver is Windows-only, it attempts to use so-called "native", or OS-level events to perform mouse and keyboard operations in the browser. This is in contrast to using simulated JavaScript events for the same operations. The advantage of using native events is that it does not rely on the JavaScript sandbox, and it ensures proper JavaScript event propagation within the browser. However, there are currently some issues with mouse events when the IE browser window does not have focus, and when attempting to hover over elements.
Browser Focus
The challenge is that IE itself appears to not fully respect the Windows messages we send the IE browser window (WM_MOUSEDOWN and WM_MOUSEUP) if the window doesn't have the focus. Specifically, the element being clicked on will receive a focus window around it, but the click will not be processed by the element. Arguably, we shouldn't be sending messages at all; rather, we should be using the SendInput() API, but that API explicitly requires the window to have the focus. We have two conflicting goals with the WebDriver project.
First, we strive to emulate the user as closely as possible. This means using native events rather than simulating the events using JavaScript.
Second, we want to not require focus of the browser window being automated. This means that just forcing the browser window to the foreground is suboptimal.
An additional consideration is the possibility of multiple IE instances running under multiple WebDriver instances, which means any such "bring the window to the foreground" solution will have to be wrapped in some sort of synchronizing construct (mutex?) within the IE driver's C++ code. Even so, this code will still be subject to race conditions, if, for example, the user brings another window to the foreground between the driver bringing IE to the foreground and executing the native event.
The discussion around the requirements of the driver and how to prioritize these two conflicting goals is ongoing. The current prevailing wisdom is to prioritize the former over the latter, and document that your machine will be unavailable for other tasks when using the IE driver. However, that decision is far from finalized, and the code to implement it is likely to be rather complicated.
Hovering Over Elements
When you attempt to hover over elements, and your physical mouse cursor is within the boundaries of the IE browser window, the hover will not work. More specifically, the hover will appear to work for a fraction of a second, and then the element will revert back to its previous state. The prevailing theory why this occurs is that IE is doing hit-testing of some sort during its event loop, which causes it to respond to the physical mouse position when the physical cursor is within the window bounds. The WebDriver development team has been unable to discover a workaround for this behavior of IE.
Clicking <option> Elements or Submitting Forms and alert()
There are two places where the IE driver does not interact with elements using native events. This is in clicking <option> elements within a<select> element. Under normal circumstances, the IE driver calculates where to click based on the position and size of the element, typically as returned by the JavaScript getBoundingClientRect() method. However, for <option> elements, getBoundingClientRect() returns a rectangle with zero position and zero size. The IE driver handles this one scenario by using the click() Automation Atom, which essentially sets the .selected property of the element and simulates the onChange event in JavaScript. However, this means that if the onChange event of the<select> element contains JavaScript code that calls alert(), confirm() or prompt(), calling WebElement's click() method will hang until the modal dialog is manually dismissed. There is no known workaround for this behavior using only WebDriver code.
Similarly, there are some scenarios when submitting an HTML form via WebElement's submit() method may have the same effect. This can happen if the driver calls the JavaScript submit() function on the form, and there is an onSubmit event handler that calls the JavaScript alert(), confirm(), or prompt() functions.
This restriction is filed as issue 3508 .
Multiple instances of InternetExplorerDriver
With the creation of the IEDriverServer.exe, it should be possible to create and use multiple simultaneous instances of theInternetExplorerDriver. However, this functionality is largely untested, and there may be issues with cookies, window focus, and the like. If you attempt to use multiple instances of the IE driver, and run into such issues, consider using the RemoteWebDriver and virtual machines.
There are 2 solutions for problem with cookies (and another session items) shared between multiple instances of InternetExplorer.
The first is to start your InternetExplorer in private mode. After that InternetExplorer will be started with clean session data and will not save changed session data at quiting. To do so you need to pass 2 specific capabilities to driver: ie.forceCreateProcessApi with true value andie.browserCommandLineSwitches with -private value. Be note that it will work only for InternetExplorer 8 and newer, and Windows RegistryHKLM_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main path should contain key TabProcGrowth with 0 value.
The second is to clean session during InternetExplorer starting. For this you need to pass specific ie.ensureCleanSession capability withtrue value to driver. This clears the cache for all running instances of InternetExplorer, including those started manually.
Running IEDriverServer.exe Remotely
The HTTP server started by the IEDriverServer.exe sets an access control list to only accept connections from the local machine, and disallows incoming connections from remote machines. At present, this cannot be changed without modifying the source code to the IEDriverServer.exe. To run the Internet Explorer driver on a remote machine, use the Java standalone remote server in connection with your language binding's equivalent of RemoteWebDriver.
Running IEDriverServer.exe Under a Windows Service
Attempting to use IEDriverServer.exe as part of a Windows Service application is expressly unsupported. Service processes, and processes spawned by them, have much different requirements than those executing in a regular user context. IEDriverServer.exe is explicitly untested in that environment, and includes Windows API calls that are documented to be prohibited to be used in service processes. While it may be possible to get the IE driver to work while running under a service process, users encountering problems in that environment will need to seek out their own solutions.
相关推荐
This is required if you want to make use of the latest and greatest ... Please make sure that this is available on your $PATH (or %PATH% on Windows) in order for the IE Driver to work as expected.
Internet Explorer Driver,简称 IE Driver,是 Selenium 支持 IE 浏览器的特定驱动程序。这个驱动程序使得 Selenium WebDriver 能够与 IE 进行通信,执行如点击、输入、导航等操作。在使用 IE Driver 之前,需要...
2. **IEDriverServer**:Internet Explorer Driver Server,顾名思义,是专为Internet Explorer浏览器设计的。与ChromeDriver类似,它允许Selenium控制IE进行自动化测试。由于IE的特殊性,使用IEDriverServer时需要...
Chrome_IE_driver_X64_X32.rar 这个压缩包文件包含了用于自动化浏览器操作的重要工具——Chrome驱动(Chrome Driver)和IE驱动(Internet Explorer Driver)。这些驱动程序是Selenium WebDriver的一部分,是一个开源...
标题中的"IEDriverServer-2.53.1"指的是Internet Explorer Driver Server的一个特定版本,这是Selenium WebDriver用于与Internet Explorer浏览器进行交互的关键组件。这个版本是2.53.1,表明这是一个软件更新的历史...
3. Internet Explorer Driver:专为Internet Explorer设计,处理IE特有的问题,如处理兼容性和安全设置。 4. Opera Driver:对于Opera浏览器,Selenium提供了一个Driver来确保自动化测试的顺利进行。 除了浏览器...
* Integrated the Microsoft Internet Explorer driver implementation into the .NET bindings. By setting the Implementation property of the .NET bindings' InternetExplorerDriverService class, the user...
Web Driver IE Driver是Selenium WebDriver的一个重要组成部分,主要用于与Internet Explorer浏览器进行交互。Selenium WebDriver是一种自动化测试工具,它允许开发者编写代码来控制浏览器并执行各种操作,如导航、...
标题中的"IEDriverServer_x64_3.4.0"指的是一个专为64位操作系统设计的浏览器自动化工具,即Internet Explorer Driver Server。这款工具主要用于自动化测试,特别是与Selenium WebDriver结合,允许开发者和测试...
之后,通过设置特定的能力来让 Internet Explorer Driver 忽略安全域名,以避免某些自动化操作中出现的不可靠因素(即 flakiness)。以下是代码示例: ```java DesiredCapabilities ieCapabilities = ...
文件包括:IEDriverServer.exe Python网络爬虫需要的插件 IEDriverServer.exe 3.9.0.0 (32-bit) Launches the WebDriver server for the Internet Explorer driver
标题中的"IEDriverServer_x64_3.141.59.zip"是指用于自动化测试工具Selenium的Internet Explorer Driver Server的64位版本,版本号为3.141.59的压缩包。这个驱动程序是Selenium与Internet Explorer浏览器交互的关键...
标题中的“IEDriver.EXE驱动”指的是用于自动化测试的Internet Explorer Driver,它是Selenium WebDriver的一部分。Selenium WebDriver是一个跨浏览器的自动化工具,允许开发者编写代码来控制浏览器进行自动化测试。...
它支持多种浏览器,包括Chrome、Firefox、IE(Internet Explorer)以及我们的主角——Edge。Edge浏览器是微软推出的新型浏览器,基于Chromium内核,提供了更好的性能和兼容性。 EdgeDriver,作为微软官方提供的...
它支持多种浏览器,包括Firefox、Chrome、Internet Explorer等。在本话题中,我们将聚焦于Selenium 3.3.1版本与Firefox的配合使用,特别是针对Firefox V47版本以及geckodriver V0.15.0。 **1. Selenium 3.3.1版本**...
Selenium WebDriver是一种用于Web应用程序自动化测试的工具,支持多种浏览器,包括Firefox、Chrome、Internet Explorer等。它提供了跨平台的API,允许开发者用不同编程语言(如Python、Java、C#)编写测试脚本。...
标题中的“IE11驱动ie_driver11”指的是用于自动化测试的Internet Explorer 11浏览器驱动程序,这个程序主要用于与Selenium WebDriver一起工作。Selenium是一个开源的Web应用程序测试框架,它允许程序员通过多种编程...
【标签】"IEDriverServer" 代表了这个软件的核心功能,即Internet Explorer Driver Server,它是Selenium WebDriver与IE浏览器通信的桥梁。通过这个服务器,测试脚本可以发送HTTP命令到IEDriverServer,进而控制IE...
Selenium是一个广泛使用的Web自动化测试工具,它支持多种浏览器,包括火狐、Chrome、Internet Explorer等。而针对每种浏览器,Selenium都需要相应的WebDriver来实现自动化控制。对于火狐浏览器,GeckoDriver就是这个...
The Internet Explorer Driver Server (IEDriverServer_x64_4.8.1.zip 和IEDriverServer_Win32_4.8.1.zip) This is required if you want to make use of the latest and greatest features of the WebDriver ...