• 介绍



  • 差异

Version number notation guide:
The version number of the IEDriverServer.exe is in the pattern as follows:

The “major” and “minor” fields are synchronized to releases of the Selenium
project. Changes in the “build” field indicate interim releases made publicly
available via the project downloads page. Changes in “revision” field indicate
private releases checked into the prebuilts directory of the source tree, but
not made generally available on the downloads page.

* Code reorganization and cleanup, mostly reorganizing header files.
* Removing support for the Microsoft IE driver implementation. This
implementation has been entirely abandoned by Microsoft, and is
unlikely to ever receive more attention.

* Release to synchronize with release of Selenium project.
* Updates to JavaScript automation atoms.

* Release to synchronize with release of Selenium project.

* Updates to JavaScript automation atoms.
* Fall back to using browser instead of document to get current URL. To
maintain compatibility with other WebDriver implementations, the IE
driver uses the IHTMLDocument2 interface to get the current URL, so
that the proper URL is returned even when an embedded frame has the
focus. However, when browsing a non-HTML document (like a PDF), the
driver cannot get an IHTMLDocument2. In that case, fall back to the
IWebBrowser2 interface.

* Updates to JavaScript automation atoms, including update to wgxpath.
* IE driver no longer returns proxy capability unless a proxy is requested.

* Modified wait algorithm to respect page load strategy for
IWebBrowser2::ReadyState. Prior to this commit, the driver would only
respect the page load strategy for document.readyState, not for the
browser COM object. This means that, for example, when IE has an info
bar being displayed (like when downloading a file), the driver will wait
indefinitely, since the IWebBrowser2 object’s ReadyState property will
never cycle over to “complete,” topping out at “interactive.” Fixes issues
#999 and #1843.

* Release to synchronize with release of Selenium project.
* (on behalf of Nathan Isom) Fixed spelling in IE driver registry path
for use in error messages.

* Updated IE driver to not error on findElements JavaScript atom errors.
Hitting a JavaScript error with the atom is an unrecoverable error. The
most common case of this for IE is when there is a page refresh,
navigation, or similar, and the driver is polling for element presence.
The calling code can’t do anything about it, so we might as well just log
and return success with an empty list. This was fixed in 2.52.1 for the
“find single element” case, but was not completely fixed for the “find
multiple elements” case. As before, this is an extreme hack, and has the
potential to be masking a very serious problem in the driver.

* Updated JavaScript automation atoms.
* Added logging of found dialog window handle for file upload dialog.

* Updated JavaScript automation atoms, including update to wgxpath library.
* Updated IE driver to return NoSuchElement on JavaScript atom errors.
Hitting a JavaScript error with the atom is an unrecoverable error. The
most common case of this for IE is when there is a page refresh,
navigation, or similar, and the driver is polling for element presence.
The calling code can’t do anything about it, so we might as well just log
and return “no such element” error code. In the common case, this means
that the error will be transitory, and will sort itself out once the DOM
returns to normal after the page transition is completed. Note carefully
that this is an extreme hack, and has the potential to be masking a very
serious problem in the driver.
* Bumped IE default file upload dialog timoeut to 3000ms.

* Removing IE driver support for ie.validateCookieDocumentType capability.
This capability was made obsolete with the rewrite of the IE driver’s
cookie handling in 2.47. It has been ignored since, so this commit removes
the IE driver code for that capability.
* Make IE driver directly return capabilities from new session command.
Previously, the driver would return a redirect HTTP response (303), and
the language bindings were expected to follow the redirect to get the
returned capabilities. This has been an obsolete pattern for some time,
and the IE driver is only now conforming to the proper pattern of simply
returning a 200 response with the correct capabilities as part of the
* Updating logic for uploading files in IE. Updating the IE driver’s handling
of sendKeys to have extra logging around finding the file open dialog. Also
rearranged the search for the dialog to more properly find the dialog using
the most common method first.

* Release to synchronize with release of Selenium project.
* Updates to JavaScript automation atoms.
* (on behalf of Anton Usmansky) Added ie.enableFullPageScreenshot capability
to allow users to create screenshots of only the current view port. The
capability defaults to true, which preserves the original behavior of
resizing the browser window and taking a screenshot of the full page.

* Release to synchronize with release of Selenium project.
* Updates to JavaScript automation atoms.

* Release to synchronize with release of Selenium project.
* Updates to JavaScript automation atoms.

* Fixed finding elements where native CSS selector engine cannot be found.

* Updates to JavaScript automation atoms.
* Changes to simplify the execution of finding elements. The driver now
delegates more of the error handling of finding elements to the JavaScript
automation atoms. This has the effect of simplifying the code within the
driver, and synchronizes the error-case behavior with other implementations.

* Release to synchronize with release of Selenium project.

* Refactoring of IE driver native events interaction code. This commit
removes the dependency on shared native event code with Firefox.
Since Firefox no longer supports native events, it makes no sense to
have common code refactored for only one consumer, so this commit
moves the Windows-only SendMessage code directly into the IE driver.
This is a first step toward deleting the webdriver-interactions
directory. While extreme care has been taken to ensure this
refactoring causes no regressions, there is a chance something will
still break. This particular refactor should also be treated as an
intermediate step, as the ported code contains some redundancies to
what is already present in the driver. Future refactoring will take
place to remove the redundancies and better integrate the code.

* Added ability to set whitelisted IP addresses to access IE driver server.
The list of IP addresses is a comma-delimited list passed to the
/whitelisted-ips command-line argument. Defaults to local loopback address
only. Also improved logging to show executable version and architecture in
driver log. Patch provided by lsowen.

* Updates to JavaScript automation atoms.
* Modifications to file upload functionality. Added additional logging
to help diagnose issues where the file selection dialog is not closed
by the driver. Also added a new capability, ie.fileUploadDialogTimeout
to allow users to customize the amount of time the driver waits for
the file selection dialog before giving up. It defaults to one second.
Finally, the driver now checks that the file exists before sending the
file name to the file selection dialog. If the file does not exist,
the sendKeys method will throw an exception explicitly stating that
the file does not exist.

* Updates to JavaScript automation atoms.
* Includes fix for clearing input elements with type “number”.

* Updating to return top-level URL when focused on a frame. This makes the
driver now consistent with other implementations.

* Release to synchronize with release of Selenium project.

* Updating screenshot code to retain scroll bars in required directions.
When an IE window needs to be resized to obtain the full-DOM screenshot,
if it has scroll bars in either direction, those scroll bars need to be
present in the resized window, so that layout recalculation doesn’t occur.
In practice, this means reducing the window size by 2 pixels in the
appropriate direction before taking the screenshot. The resulting scroll
bars are cropped from the image.

* Updates to JavaScript automation atoms.
* Updating screenshot code to prevent resizing if window is large enough.
In the previous screenshot update, the driver would incorrectly resize
the IE window smaller if the document was smaller in height or width
than the current window size. This could cause redraws of the page
being viewed such that after resizing, the screenshot still did not
display the entire page. This commit resolves that issue, and also takes
into account the size of the scroll bars when creating the screenshot
image. NOTE: There is a *very* slight chance that resizing the window
so there are no longer scroll bars to be displayed *might* still cause
layout redraws such that the screenshot does not show the entire DOM
after the resize. Since we should now always be expanding the window size,
never contracting it, this is a corner case that explicitly will *not* be
fixed. Any issue reports describing this corner case will be closed without
action. Fixes issue #1085.

* Updates to JavaScript automation atoms.
* Removed use of Windows hooks for taking screenshots in IE. This will fix
the issue of taking full-page screenshots when using the 32-bit IE driver
on 64-bit Windows installations.

* Corrected build process to create executables runnable on Windows XP.

* Added logging messages for IE driver for bitness mismatches. This commit
adds logging messages at the warning level whenever a mismatch in bitness
is detected between the browser and driver. This is a particularly bad
problem in cases where users have 64-bit Windows, and (incorrectly) assume
they automatically should use the 64-bit IEDriverServer.exe when running
with IE 10 or 11. Since the process that actually renders content in IE 10
and 11 is almost always 32-bit, even on 64-bit Windows, it is almost always
the proper decision to use the 32-bit IE driver. It is now very clear from
log messages when this state of affairs exists.
* Enabled fast failure for cookie manipulation in IE. The refactor of cookie
handling for the IE driver introduces an incompatibility with the 64-bit IE
driver and IE 10 and 11 running on 64-bit Windows. As is the case with
sending keystrokes and creating screenshots, a Windows hook procedure is now
used for getting and settingcookies in IE. That means that in IE 10 and 11
on 64-bit Windows, where the content rendering process is still 32-bit, you
**must** use the 32-bit IEDriverServer.exe in order to manipulate cookies.
This commit will now cause exceptions to be thrown if you attempt to set
or get cookies using the 64-bit driver against a 32-bit version of IE (or
vice versa), but in particular, this will affect users who mistakenly try
to use the 64-bit executable with IE 10 or 11 in 64-bit Windows.

* Release to synchronize with release of Selenium project.
* Updates to JavaScript automation atoms.

* Fixed handling of authentication dialogs for different Windows versions.

* Enabling handling of authentication dialogs in IE driver.
* Modified to resize IE window for screenshots using dimensions of top-level
document when focused on a frame. Fixes issue #703.

* Init last known mouse position with -1, -1. This avoids issues where the
first operation is to move the mouse to [0, 0]. Patch provided by Anton

* Fixed bug in SOCKS proxy authentication settings retrieval.

* Fixed bug in screenshot handling due to Windows hook refactor.

* Fixed cookie delete bug for related domains.

* Corrected cookie add/delete logic with respect to HTTP-only cookies.

* Updates to JavaScript automation atoms.
* Updated delete cookie logic to no longer rely on JavaScript. This allows
HTTP-only cookies to be deleted by the driver.
* Added support for SOCKS proxy in the IE driver. Using a SOCKS proxy is not
quite as straightforward for IE as it is for other browser drivers. While
the driver is now able to set the proxy settings for a SOCKS proxy, using
the ie.usePerProcessProxy capability with a user name and password for a
SOCKS proxy is problematic for the driver. The Windows API does not provide
any ability to set the user name and password for a SOCKS proxy on a
per-process basis. The driver attempts to work around this limitation, but
this combination will be largely unsupported. Using the driver to temporarily
set the global proxy settings on the machine should work as normal.

* Corrected logic for http-only and secure cookies. Cookies now behave
in IE as expected. The driver will properly return ‘secure’ or
‘httpOnly’ flags as set on the cookie itself. Note carefully that
‘secure’ cookies will only be retrieved when browsing a page using
SSL (https), as this is the only environment where the cookies are
used by the browser. This behavior is consistent with the behavior
of the Chrome driver, and with the W3C specification behavior for
cookies. Firefox, it should be noted, returns secure cookies regardless
of whether the page in question is being browsed via SSL or not.
This is a bug in the Firefox driver.

* Fixed IE cookie handling for down-level operating systems.

* Updates to JavaScript automation atoms.
* Refactoring Windows Hooks. Windows hooks are now wrapped in a single class,
eliminating a fair amount of duplicate code.
* Rewrote cookie handling for IE. The IE driver should now be able to return
full information for most cookies, including expiration date and secure
status. Additionally, the driver will now return HTTP-only cookies from
IE. Note that some specific cookie information will still be incomplete.
In particular, session cookies that may have been set with domain, path,
or secure tokens in the cookie string will not have those tokens set in
the returned cookie, as that information is not available via any API.
Also note that this change introduces additional use of Windows APIs that
are not supported when run from a service process, making that more
completely unsupported. Fixes issue #391.

* Handles issue with alert text controls conatining no accText property in IE.
Fixes issue #651.

* Release to synchronize with release of Selenium project.
* Updates to JavaScript automation atoms.

* Updates to JavaScript automation atoms.
* Allow IE driver to work with transparent file upload elements. Many modern
JavaScript widget frameworks hide <input type=”file”> elements so as to
make their UIs “prettier.” The IE driver would see these elements as not
visible, and thus not interactible. This commit allows users to use sendKeys
to upload files when this type of file upload element exists, bringing the
driver in line with what is allowed by the Firefox driver.

* Changed to allow interaction with elements where opacity = 0. The
isDisplayed will still return false for those elements, as is consistent
with drivers for Firefox and Chrome. Fixes issue #503.

* Added busy check after attaching to newly launched IE instance.
* Corrected logic in ‘eager’ page loading strategy for IE.

* Updates to JavaScript automation atoms.
* Corrected wrong value for pageLoadStrategy capability.
* Reset browser window handle on failure to attach via Active Accessibility.
When launching a new instance, if the driver attempts to use Active
Accessibility to attach to the instance, and the attach fails, the driver
should attempt to attach using the ShellWindows API. However, this fallback
is skipped if the window has already been found. Resetting the found window
handle to NULL allows the driver to proceed with the second attempt.

* Updates to JavaScript automation atoms.
* Added pageLoadStrategy to IE driver. Setting a capability named
pageLoadStrategy when creating a session with the IE driver will now change
the wait behavior when navigating to a new page. The valid values are:

“normal” – Waits for document.readyState to be ‘complete’. This is the
default, and is the same behavior as all previous versions of
the IE driver.
“eager”  – Will abort the wait when document.readyState is
‘interactive’ instead of waiting for ‘complete’.
“none”   – Will abort the wait immediately, without waiting for any of
the page to load.

Setting the capability to an invalid value will result in use of the
“normal” page load strategy.
* Added delay and logging on attaching to launched IE. There are times when
the two methods used for attaching to a launched instance of Internet
Explorer will fail. This commit adds additional logging to help make
diagnosing the exact failure points of these circumstances easier.

* Updates to JavaScript automation atoms.
* Changed to prevent crash when driver fails to connect to IWebBrowser2

* Release to synchronize with release of Selenium project.
* Updates to JavaScript automation atoms.

* Fixed passing per-process proxy settings to new windows. Fixes issue #8112.

* Fixed finding elements by XPath for IE 9 where document mode is less than

* Updates to JavaScript automation atoms.
* Added additional logging to cache clearing code
* Updated session intialization to more robustly handle malformed JSON.
Previously, in the IE driver, malformed JSON requests when requesting a
new session would cause the driver to crash. The new behavior is that
if the JSON payload for the new session is malformed by not including
a desiredCapabilities object will now throw an exception. If the user
passes a capability value with the wrong data type, it will be logged
by the driver at a warning level, and the default value for the specified
capability will be used.

* Updates to JavaScript automation atoms.
* Introduced capability to disable check of document type when setting
cookies. When setting cookies, there is a check in the IE driver to validate
that the page in the browser is, in fact, an HTML page. Despite the fact
that omitting this check can cause unrecoverable crashes in the driver,
there is demand for a mechanism to disable this check for older, legacy
versions of Internet Explorer. This commit introduces a new capability,
“ie.validateCookieDocumentType” which, when set to false, skips this check
when adding a cookie. The default for this capability when unspecified for
a session is true; users setting this capability to false are considered to
be on their own when encountering issues setting cookies, including, but not
limited to, crashes in the driver executable. Fixes issue #1227.

* Release to synchronize with release of Selenium project.
* Updates to JavaScript automation atoms.

* Implemented retrival of alert text for onBeforeUnload dialogs. Fixes issue

* Improved cross-platform compatibility of webdriver-server C++ code. This
commit makes the common webdriver-server C++ code more easily cross-
platform. It does this mainly by removing use of std::tr1::regex, which has
issues compiling under gcc. In its place, we now use a custom URL matching
algorithm for matching URLs in the WebDriver JSON Wire Protocol. While this
matching algorithm may be a potential source of future errors, a nice side
effect of it is a 3% performance increase in server execution times over
using regular expressions. Additionally, this commit includes an alias for
snprintf, which throws buffer overrun warnings when used with Visual Studio.
It also contains some header #include rearranging and linting of the C++
* Implemented driver implementation autodetect in IE driver server. When
specified by the correct command line switch, the driver will use the
Microsoft driver implementation, if the detected version of IE is 11 or
higher, and if the implementation is installed. Otherwise, it will fall
back to the legacy (open-source) implementation.
* Updated third-party C++ library dependencies. This resolves compiler
warnings when compiling Civetweb and JsonCpp under Visual Studio.

* Release to synchronize with release of Selenium project.
* Updates to JavaScript automation atoms.
* Integrated the Microsoft Internet Explorer driver implementation.

This commit optionally allows the user to use the Microsoft-supplied
implementation of WebDriver for IE 11 and above. To use the Microsoft
implementation, the user must have the August 2014 updates to Internet
Explorer installed through Windows Update, and must install the IE Web
Driver Tool for Internet Explorer 11 download from Microsoft

Once those prerequisites are installed, the user can use the
InternetExplorerDriverService object in the language bindings to set the
implementation to be used.

By default, the driver will continue to use the driver implementation
developed by the open-source project. Over time as the Microsoft
implementation matures, this will be switched to use that implementation,
first by default, then exclusively.
* Fixed IEDriver crash in WaitUntilElementFocused() because of null pointer.
Added required null check after document->get_activeElement() call
(see MSDN documentation for more information). Fixes issue #7577. Patch
provided by Dominik Rauch.

* Updated json-cpp lib and replaced mongoose web server with civetweb. The
Mongoose project has changed its licensing to GPL. This change replaces
Mongoose with Civetweb, a fork of the Mongoose project at the last commit
under the previous license. Civetweb is licensed using the MIT license.
Additionally, the JsonCpp project has moved and changed owners. It now has
a much simpler method of source code incorporation into additional projects.
See the README.txt in third_party/json-cpp for information about how to
generate the code included here.

* Implemented switchToParentFrame command.

* Release to synchronize with release of Selenium project.
* Updates to JavaScript automation atoms.

* Fixed IE driver to allow JavaScript objects with property names with spaces.
Fixes issue #7305.

* Updates to JavaScript automation atoms.
* Fixed crash when clicking on link that opens a new window.
When IWebBrowser2::Quit() is called, the wrapper process doesn’t exit
right away. When that happens, CoCreateInstance can fail while the abandoned
iexplore.exe instance is still valid. The “right” way to do this would be to
call ::EnumProcesses before calling CoCreateInstance, finding all of the
iexplore.exe processes, waiting for one to exit, and then proceed. However,
there is no way to tell if a process ID belongs to an Internet Explorer
instance, particularly when a 32-bit process tries to enumerate 64-bit
processes on 64-bit Windows. So, we take the brute force way out, just
retrying the call to CoCreateInstance until it succeeds (the old
iexplore.exe process has exited), or we get a different error code. We also
set a 45-second timeout, with 45 seconds being chosen because it’s below the
default 60 second HTTP request timeout of most language bindings. Fixes
issue #5848. Fixes issue #7021.

* Release to synchronize with release of Selenium project.

* Updates to JavaScript automation atoms.
* Release to synchronize with release of Selenium project.

* Improved error message for findElements in the failure case.
* Added additional logging for failure of get_mimeType when setting cookies.
* Fixed edge case for finding elements by class name with invalid characters.
The fix should be isolated only to situations where the IE document mode
is 8 or less. In other words, it should fix the case for quirks mode for
IE9 or below, and for standards mode for IE8 or below.

* Reorganized wait algorithm in HtmlDialog. Now is more correctly aborting
the wait if a new (cascading) dialog is detected. Fixes issue #6744.

* Modified to use bot.dom.getOverflowState atom for element overflow. This
is a more reliable and fully tested method than previously used. There is
still a minor issue when the element point in question is exactly on the
overflow border, but this needs to be addressed in the atoms code, rather
than at the IE driver level. Fixes issue #6898.

* Update call of isDisplayed atom in IE to not ignore opacity. Previously,
the driver explicitly ignored opacity for IE, but now takes it into account.
Fixes issue #6827.

* Updates to JavaScript automation atoms.
* Attempted fix for finding multiple elements with invalid CSS selectors.

* Updates to JavaScript automation atoms.
* On behalf of Mark Watson: Added ability to attach to IE using the
ShellWindows API instead of the ActiveAccessibility API. This is useful
when the Windows global atoms table is exhausted. Fixes issue #5342.

* Improved error message for failed launch of IE using IELaunchURL API.
We now translate the HRESULT received from the API into a text error

* Release to synchronize with release of Selenium project.

* Updates to JavaScript automation atoms.
* Release to synchronize with release of Selenium project.

* Updates to JavaScript automation atoms.
* Fixed crash encountered when taking screenshot of non-HTML page. This does
not throw an error, but fails silently, with no screenshot being generated.
Fixes issue #6576.

* Refactored detection of single-text-node child elements in IE. In IE, a
containing text and no background color will not register as a hit target
unless the mouse cursor is directly over the text of the element. However,
in the case of block elements with children that include text nodes in
addition to other elements, if the first text node does not contain any
text, the correct behavior is to use the center of the block element for
mouse movements. This commit corrects that behavior.

* Refactored notification of new showModalDialog windows. Previously, the
code notifying the command executor of new HTML dialog windows (opened by
the showModalDialog function) would not always fire in the case where a
second modal was opened from a first. We now notify of the existence of
the new modal whenever a modal is found. This has the potential to cause
mild performance degredation in the modal dialog case, but this is a small
price to pay for the correctness of the driver. Fixes issue #6416.

* Updates to JavaScript automation atoms.
* Modified detection of HTML page. The method for retrieving the expected
type description for HTML pages was far more complex than it needed to be.
We now use the AssocQueryString API instead of trying to read the registry.

* Release to synchronize with release of Selenium project.

* Release to synchronize with release of Selenium project.

* Fixed bug in getting element location.

* Updates to JavaScript automation atoms.
* Added padding for IE < 8 for getting invisible element location. Invisible
elements on IE 6 and 7 have a 2-pixel border that must be added.

* Fixed HTML dialog logic for self-closing documents. HTML dialog windows
opened using showModalDialog() have no way to properly notify of their
closing. The IE driver attempts to detect closing of these windows by
listening for user-initiated actions, either by calling the WebDriver close
method, or clicking on an element that causes the dialog to close. This
commit adds logic to the method used for getting all window handles to
validate the existence of any HTML dialog windows, properly notifying the
driver if the OS-level window handle is no longer valid. Fixes issue #6249.
* Fixed HTML dialog logic for redirected documents. Getting the parent window
of an HTML dialog’s document can fail, especially if the document changed
out from under us before we could get the window reference. The canonical
case for this is a redirect using JavaScript. Now we will sleep for a short
time, then retry to obtain the reference to the window object. Fixes issue

* Updates to JavaScript automation atoms.
* Adding more accurate logging during waiting for browser navigation to

* Updates to JavaScript automation atoms.
* Fixed problem getting SVG elements in IE9 and above.

* Version number change only for public release to downloads page.

* Take document mode into account when getting size of view port for element

* Updates to JavaScript automation atoms.
* Refactored calculations to the size of the visible view port. There are
circumstances where IE can have no vertical scroll bar. In these cases, the
IE driver would assume there was a vertical scroll bar, which would make the
actual width of the document larger than the computed width of the window.
This, in turn, would make the driver assume there was a horizontal scroll
bar, which would imply that absolutely-positioned elements at the bottom of
the page would not be seen as clickable.
* Modified to ignore frames which can not be retrieved by
IHTMLFramesCollection2::item while waiting for page load complete. This
change prevents infinite page load on IE9 for pages with frameset that do
not specify column or row counts. Fixes issue #3211.

* Updated to correct active element finding when using synthetic events. Fixes
issue #6088.

* Release to synchronize with release of Selenium project.
* Updates to JavaScript automation atoms.
* Preventing crash in IE driver using synthetic events. In some cases
document.activeElement returns an empty object rather than null. This could
cause the IE driver to crash. This change fixes the crash, but not the
underlying JavaScript atoms issue. This is handled by another commit. Fixes
issue #6067.
* Added PAC and proxy autodetect (WPAD) support to IEDriverServer.exe.

* Release to synchronize with release of Selenium project.
* Updates to JavaScript automation atoms.

* Fixed memory allocation in ProxyManager class to work correctly under
Release builds.

* Added error checking in DocumentHost::GetPageSource. Fixes issue #5967.
* Removed StringUtilities methods to create strings from longs. The C++
standard type libary already provides std::to_string() and std::to_wstring()
for this purpose.
* Introduced ability to clean browser cache before launching IE. This version
introduces the ie.ensureCleanSession capability, which will clear the
browser cache, history, and cookies before launching IE. When using this
capability, be aware that this clears the cache for all running instances of
Internet Explorer. Using this capability while attempting to run multiple
instances of the IE driver may cause unexpected behavior. Note this also
will cause a performance drop when launching the browser, as the driver will
wait for the cache clearing process to complete before actually launching
* Refactored Proxy setting handling in IE driver. We no longer need to replace
the window procedure to accomplish setting the proxy on a per-process basis,
simplifying the process considerably. This version also modifies the
ProxyManager class to let it build the proxy setting string instead of
prebuilding it in the new session command handler. Finally, this version
allows the proxy settings to be passed back to the language bindings via the
return from the getSessionCapabilities command handler.

* Added Proxy support to the IE driver native code. This commit adds proxy
support to the native code of the IE driver, having it recognize the proxy
capability in the WebDriver JSON wire protocol. The default behavior will
change the system proxy when a new instance of the IE driver is created.
This means that from that point forward, all IE instances, including those
*not* started by WebDriver, will use the same proxy information. The driver
will attempt to reset the system proxy to the previous settings when the
session is properly exited by use of the quit method. Be aware that this
means that crashes in the driver may leave the system’s proxy settings in an
inconsistent state, and it further implies that attempting to drive multiple
instances of IE using proxy settings will likely do the same.

The driver sets the proxy settings by means of the Windows WinINet API,
which explicitly cannot be used from within a Windows service. This implies
that IEDriverServer.exe cannot be used from within a Windows service.

This commit also introduces a new capability, “ie.usePerProcessProxy”. This
capability takes a boolean value, and defaults to false. When set to true,
it attempts to only set the proxy information for a single IE process, and
does not affect the proxy settings of other instances of IE. Use of this
capability should be considered extremely experimental at present,and may
cause IE to behave inconsistently when attempting to use a proxy with this
capability set.

* Refactored IE driver to take advantage of new StringUtilities methods.
* Refactored BrowserFactory class to use member variables. Previously, most
functionality was passed into the methods of the BrowserFactory, breaking
the principle of encapsulation. This change also moves the ability to force
the use of the Windows CreateProcess API and to pass command-line parameters
to the CreateProcess API to capabilities of the IE driver, rather than
arguments passed via the command line of IEDriverServer.exe.

* Refactored IE driver registry access methods to RegistryUtilities class.
This eliminates the need for an unnecessary extra instance of the
BrowserFactory class.
* Implemented logging for IE driver HtmlDialog class.
* Cleaned up IEDriver logging on asynchronous script execution.

* Corrected logic for invisible element coordinate calculation on IE6 and 7.

* Reverting logic change for invisible element coordinate calculation on IE6
and 7.

* Corrected logic for invisible element coordinate calculation on IE6 and 7.
* Fixed logic error in Script::ExecuteAsync() waiting for exclusive access to
* Added IE-specific atoms to eliminate round-trips through IE’s JS engine. The
findElement and findElements atoms take a JavaScript object as their first
parameter. Until now, that facilitated a round-trip through the IE
JavaScript engine to be able to create the JavaScript object to pass into
the atom function. We are now creating IE-specific JavaScript functions that
wrap those two atoms, and take simple strings as arguments, which lets the
IE driver call the atom directly without having to call a separate script
that simply creates the JavaScript criteria object.
* Removed extra round-trips through JavaScript engine when executing
JavaScript. This should provide a slight performance boost when executing
JavaScript that returns arrays or JavaScript objects.

* Updates to JavaScript automation atoms.
* Corrected logic in getting location of element after scrolling into view.
For IE 6 and 7, an additional 2-pixel offset must be added for every frame
on the page when calculating element location.

* Refactored session shutdown code to properly wait for thread termination.
Fixes issue #5543.

* Release to synchronize with release of Selenium project.

* Modified to better detect focus on incorrect UI elements when
requireWindowFocus is specified.

* Updates to JavaScript automation atoms.
* Prevent double-clicks when using When using the
requireWindowFocus capability, it’s possible that multiple calls to might happen too quickly, and they might be interpreted
as a double-click. This change inspects the last time an element was clicked
on, and if it is within the system double-click time, it waits until that
time passes before performing the second click.
* Made InputManager more robust in the requireWindowFocus case. Previously,
using the Windows SendInput API could cause keystrokes and mouse events to
be added to the system message queue, but would return back to the caller
before those events were processed by Internet Explorer’s message loop.
This change adds a Windows mouse hook and keyboard hook to monitor when
the messages are processed by an applications message loop. There is still a
potential race condition, and users may still need to execute some local
synchronization code.

* Refactored IE driver element click code to all use InputManager class.
Previously, used a different code path than the Advanced
User Interactions API. These code paths are now unified for the native
events case.

* Reinstated separate-thread execution of JavaScript on Windows 8. This
functionality had been disabled in, because of crashes in the IE
driver on Windows 8. It seems likely that the COM object lifetime cleanup
that happened in corrected these problems. There is a possibililty,
however, that the root cause of the Windows 8 crashes is still in place. If
that is the case, this change should be rolled back.

* Modified to check the editable state of an element before clearing.
The clear Automation Atom normally checks that an element is interactable
and editable before attempting to clear it. A previous change fixed the case
for checking the interactable state, but not the editable state. The driver
will now check the editable state as well. To facilitate this, a new atom
has been exposed for checking the editable state.

* Modified to check the interactable state of an element before clearing.
The clear Automation Atom normally checks that an element is interactable
before attempting to clear it. Unfortunately, when the atom is run on a
separate thread in legacy IE, the error states do not get propagated back to
the calling thread properly. To avoid this problem, the driver will check
the interactable state before calling the clear atom. To facilitate this, a
new atom has been exposed for checking the interactable state.

* Increased timeout for asynchronous JavaScript execution. This allows more
time for automation atoms to complete their operations before timing out.
* Modified to throw if an element is not enclosed within a form in IE.

* Updates to JavaScript automation atoms.
* Refactoring asynchronous execution of JavaScript in IE driver. This
introduces a new method for executing JavaScript functions asynchronously
via a new thread. This centralizes the code used to execute automation atoms
that may cause an alert to display (like click or submit or clear). Fixes
issue #5556.

* Corrected logic error in implementing loop. The code was intended to use a
loop, but instead used a simple if statement.

* Updates to JavaScript automation atoms.
* Added retry loop for handling alerts on shutdown. Previously the IE session
would only check twice for alerts on shutdown. This handles the case of
repeated alerts, and will check up to six times, for a total of 30 seconds.

* Corrected dismissal of dialogs on browser quit. The IESession object already
had code to check that the IECommandExecutor had fully quit before shutting
down the thread on which the executor was running. However, it had no code
to handle the case where all browser instances for that session were not
properly shut down. Now the session will ask the executor to check one final
time and make one last-ditch effort to dismiss any dialogs and shut down
the browser instances. Please note that the best practice is to handle any
alerts that may appear in web pages being automated before executing
driver.quit(); this should only be used as a last resort.

* Corrected dismissal of onBeforeUnload dialogs. We now notify the button’s
immediate parent, instead of sending a message to the button. Sending the
BM_CLICK message to the button can fail if the dialog doesn’t have the
system focus.

* Corrected logic error in alert handling. A slight logic error in the alert
handling code was causing the alert handling to not wait for the alert to be
completely dismissed before continuing. This was causing a race condition
that could lead to crashes when quitting the browser if certain types of
alerts were active. Fixes issue #5489.

* Corrected number of script arguments in InputManager::SendKeystrokes. In a
recent refactor, this code was slightly changed, and the declaration of a
Script object was expecting three arguments instead of the required four.
Fixes issue #5502.

* Corrected logic error in reading TabProcGrowth registry value. The
TabProcGrowth registry value can be a DWORD or a string. If it is a string,
it can be a numeric string (e.g., “0”), and still be treated by Internet
Explorer as if it were an actual numeric value. This change to
BrowserFactory::GetRegistryValue() correctly handles both cases, coercing
the value to a string type for comparison.

* Modified IEDriverServer to take new command-line switches to allow click on
users to force the use of the Windows CreateProcess API for launching IE.
For some cases, it may be necessary to launch IE in Private mode for
testing in parallel on a single node. To support this, there must be a way
to force the IE driver to use the Windows CreateProcess() API to launch IE
so that the user can specify command-line switches. To preserve the
ability to locate the correct process for IE versions 8 and higher, a
registry value must be set to a specific value, and the IE driver checks for
the registry value before launching IE. Patch for this fix provided by Alex
Savchuk.The registry settings are:

Key: HKEY_CURRENT_USER\Software\Microsoft\InternetExplorer\Main
Value Name: TabProcGrowth
Value: “0”

* Fixed Element::IsAttachedToDom() when used with SVG for IEDriver.
Patch for this fix provided by Patrick Gansterer.

* Fixed to allow click on visible portion of element if center point cannot be
scrolled into view. This fixes issue #4390 for IE. There is still a fix that
needs to be made for Firefox for the issue to be closed. Patch provided by
Alex Savchuk.

* Release to synchronize with release of Selenium project.

* Updates to JavaScript automation atoms.
* Fixing to no longer allow stale element references to be used in JavaScript
execution. The driver now checks the return value when recursively walking
JavaScript arrays and objects. Fixes issue #4769. Patch provided by Alex

* Updates to JavaScript automation atoms.
* Refactored IE element finder to make clearer when Sizzle is used.
Previously, it was not as easy to determine from IEDriverServer.exe logs
when Sizzle was being used for finding elements by CSS selector. It is now
explicitly called out and logged. Also, automation atoms are being used when
Sizzle is not necessary.
* Simplified COM object handling code in IE driver. COM objects are now
correctly referenced everywhere via smart pointers, and use of some aliased
types is now replaced by the C++ primitives.

* Added ability to get current URL from IWebBrowser2 if IHTMLDocument2 fails.
Under normal circumstances, the IE driver gets the current URL from the
document loaded in the browser. When IE browses to a non-HTML page, such as
a PDF file with the Adobe Reader plugin installed, getting the document
fails, since there is no “document” in the browser. In that case, fall back
to getting the LocationURL property of the IWebBrowser2 interface. It’s
arguable that this is the wrong thing to do, since the driver is useless
without an actual document, but we’ll let this work anyway. Fixes issue
* Updated logic in IE driver to correctly wait for the document. Fixes issue
* Submit should throw NoSuchElementException if the target element is not
within a form. Implemented in atoms, Firefox and HtmlUnit.
* Reinstated execution of JavaScript on separate thread for IE10 on Windows 7.
* Removed use of CComQIPtr from IE driver native code. The use of CComQIPtr is
not needed, as we are substituting a call to the QueryInterface method
instead. This is what CComQIPtr does under the covers anyway.

* Release to synchronize with release of Selenium project.

* Introduced “browserAttachTimeout” capability. This allows the user to set a
capability to control how long the IE driver will attempt to locate an IE
browser window belonging to the iexplore.exe process launched by the driver.
This is to overcome the bug reported by some users that the IELaunchURL
Windows API reports the incorrect process ID for the launched iexplore.exe
process. In this case, there is nothing the IE driver can do about the
problem as the bug is inside IE itself. However, this will allow a user
to exit the offending situation early, and attempt to recover. The
capability expects an integer value, representing the number of milliseconds
the driver will contininue to look for the newly-launched IE window. Setting
the capability to 0 (which is its default value) will cause the IE driver to
wait indefinitely. Fixes issue #4541.

* Fixed issues found via static code analysis.

* Simplified element scroll calculation code by using the new
isInParentOverflow atom.

* Hacked around the case where McAfee SiteAdvisor is installed as a plugin for
IE. Modal dialogs are now checked for existence of the WS_CAPTION style.
Note that if IE ever decides to change how it displays alerts, this may
begin to cause failures in alert detection. Fixes issue #4839.

* Updates to version resources. No functional changes.

* Updates to JavaScript automation atoms.
* Fixed incorrect JSON return values for findElements when an error occurs.
This is a “best-faith” effort at resolving reports of NullPointerExceptions
in Java. If future occurrances of the symptoms are found, please open a new
issue. Fixes issue #3800.

* Fixed auto-release of modifier keys when using element.SendKeys with
requireWindowFocus capability.

* Enabled synthetic events mouse clicks to work even when the click triggers
a JavaScript alert.

* Updated to use correct parameter in message loop for executing asynchronous
JavaScript. Fixes issue #5137.

* Allowed the IE driver to get the text of a prompt() dialog window. Fixes
issue #4594.

* Updates to JavaScript automation atoms.
* Removed checking for element visibility and non-zero size from method used
for scrolling elements into view and getting their location.
* Fixed unexpected occurrences of UnhandledAlertException after closing modal
dialogs created using showModalDialog().

* Updates to JavaScript automation atoms.
* Modified method for checking whether modifier keys should be automatically
released when calling sendKeys, either from an element or from the actions

* Updates to JavaScript automation atoms.
* Modified findElement implementations to fail without waiting for the
implicit wait timeout to expire if finding on a closed window. Fixes issue

* Updates to JavaScript automation atoms.
* Dampened excessive noise in IE driver logging.
* Modified to initialize value_ member of Response to Json::Value::null upon
* Updated IEDriverServer.exe to correctly return the current version in the
JSON response for the /status end point of the JSON wire protocol.
* Added usage info to IEDriverServer.exe when using /? /h or /help.
* Removed dead code from ScreenshotCommandHandler.

* Initialized value_ member of Response to Json::Value::null upon creation.
* Suppressed warnings written to console during browser startup and shutdown.
* Updated to correctly return the current version in the JSON response for the
/status end point of the JSON wire protocol.
* Added usage info to IEDriverServer.exe when using /? /h or /help. Also
removed dead code from ScreenshotCommandHandler.

* Introduced the “requireWindowFocus” capability into the IE driver. When used
in conjunction with the “nativeEvents” capability, the driver will attempt
to bring the current IE window to the foreground before executing a mouse
or keyboard event. Also, when the requireWindowFocus capability is set to
true, advanced user interactions will now use the Windows SendInput() API to
execute the interactions. To enable this behavior, set the value of the
requiresWindowFocus capability to “true” when creating an instance of the IE
driver. The default for this new capability is “false”. This functionality
is currently considered extremely experimental; use at your own risk.

* Changed view port calculations to allow for always-present vertical scroll
bar, and to test for horizontal scroll bar and adjust as required by page
content. Fixes issue #3602.
* Changed IE GetLocationOnceScrolledIntoView behavior to take the 2-pixel
border of the <html> element used by IE7 and below (and document modes that
emulate that).
* Extracted map of managed elements in IE driver to ElementRepository class.
First step in a potentially larger refactor.

* Attempted to change coordinate calculations due to frame offsets to handle
the cross-domain frame case. This change rests on the assumption that the
order of frames returned by the JavaScript document.frames collection is
the same as that returned by document.getElementByTagName(“frame”) or
document.getElementByTagName(“iframe”). Fixes issue #4948.

* Changed the shared WebDriver C++ server component to use strings in
serialized commands instead of integers. Testing does not seem to indicate
this will introduce a performance issue, and it makes logs more intelligible
when logging the raw JSON of a received command. As far as anyone can
determine, the only consumer of this component is the IEDriverServer.exe, so
this should be a completely internal change.

* Release to coincide with full Selenium release.

* Updates to JavaScript automation atoms.
* Define document on for fragments, as the closure library now
depends on it. Fixes issue #4802.

* Fixed SendKeysCommandHandler to check that the focus is in the HTML display
pane, and not some other UI element (like the address bar) before sending
the keystrokes.

* Added new capability “enableElementCacheCleanup”. When set to true, the
IE driver will clean the known-element cache of invalid elements after
every page load. This is intended to keep memory usage down and improve
performance. However, it is an intrusive change, so this capability is
provided temporarily to allow disabling this behavior if problems arise.
The default of this new capability is “true”, meaning this behavior is
turned on by default.
* Refactored IE driver Element class to contain IsAttachedToDom() method,
and IECommandHandler::GetElement() to use it.
* Modified to avoid logging the tag name of the element if getting the tag
name fails in the IE driver. Fixes issue #4811.

* Corrected fix to issue #4800 to better handle nested frames.
* Refactored native code to return the location of each frame containing an
* Refactored location methods of native IE driver code to take a LocationInfo
struct instead of separate args for x, y, width and height.

* On behalf of AdamWu: Fixed calculation of coordinates for elements in
frames/iframes where the element is scrolled out of view within the frame.
Fixes issue #4800.

* Disabled execution of JavaScript code on a separate thread for IE10. This
reverts the behavior of the driver to that before for IE10 *only*.
* Updates to JavaScript automation atoms.

* Modified to return ENOSUCHDRIVER if a session is not available.

* Fixed synchronization issues. These issues were always present, but never
manifested until the IE driver was used with IE 10.
* Reinstating functionality to run JavaScript on a separate thread on Windows

* Removed functionality to run JavaScript on a separate thread on Windows 8.

* Attempted to resolve crash on Windows 8 introduced by JavaScript execution
on a separate thread. Added checks for proper interface marshaling on the
worker thread.

* Updates to JavaScript automation atoms.
* Modified to no longer hang on alerts triggered by onchange of <select>
elements or by onsubmit of <form> elements. Fixes issue #3508. Fixes
issue #2103.

* Modified scroll behavior in IE driver SendKeysCommandHandler to call
Element::GetLocationOnceScrolledIntoView() instead of calling the DOM
scrollIntoView() function. Fixes issue #4393.
* Modified to not call blur() on focusing element if the active element is
the <body> element. This should no longer cause the IE window to drop to
the bottom of the Z-order. Fixes issue #2353 and related.

* Updates to JavaScript automation atoms.
* Release to coincide with full Selenium release.

* Modified so that closing a window (or quitting a browser) now sets the
focused frame to NULL, as if switchTo().defaultContent() had been called.
This is to prevent crashes of the executable when quitting the driver. Fixes
issue #4178.

* Added use of a mutex when creating a session. This should allow multiple
threads to create and use different instances of IEDriverServer.exe,
enabling multiple instances under most language bindings.
* Added enablePersistentHover capability to allow users to turn off persistent
mouse hover within the IE driver.

* Refactored alert handling to allow handling of OnBeforeUnload dialogs. This
is a slightly incomplete solution, as the dialog is not automatically
handled on window close/browser exit. To work around this limitation,
navigate to a different page (handling the OnBeforeUnload dialog), then
call the quit() method.

* Updates to JavaScript automation atoms.

* Allowed buttons on alerts with control IDs of IDRETRY to be handled as
“OK” buttons, which should allow them to be handled by Alert.accept().

* Modified find-by-XPath code to correctly escape embedded quotes before
invoking the findElement atom.

* Updates to JavaScript automation atoms.
* Updated to use Wicked Good XPath (
as the XPath engine for the IE driver.

* Updates to JavaScript automation atoms.

* Modified behavior such that sending a Quit command on a non-existent
session is now a no-op, and does not return an error code.

* Added command-line switch to control to where the IEDriver.dll is extracted.
Not specifying the switch causes the file to be extracted to the temp

* Corrected searching for alert windows from windows opened by

* Implemented “silent” command-line switch on IEDriverServer.exe to suppress
printing to console of initial diagnostic information.

* Implemented check in GetCurrentWindowHandleCommandHandler to verify that
window handle is a valid window, returning a NoSuchWindowException if it
is not. This was originally broken in r17651.

* Implemented checks to ensure alerts are completely dismissed by IE before
continuing to the next command.

* Implemented automatic dismissal of alerts, settable by capability.
* Implemented navigation back and forward through browser history on a
separate thread, so as to no longer hang on alerts.

* Fixed the case verifying whether a page in the browser is an HTML page, and
the default browser does not register its MIME type in the (default) value
at HKEY_CLASSES_ROOT\<browser HTML page class name>. Fixes issue #4307.

* Increased logging when getting registry values.
* Fixed spacing in log messages

* Updated to return ENOSUCHWINDOW if trying to switch to a window ID that does
not exist.

* Fixed IE6 case for checking browser zoom level.
* Now repeatedly sending WM_MOUSEMOVE messages on a separate thread to try to
quell mouse hover issues.

* Added error checking for zoom level for IE. The IE driver will now throw an
exception if the zoom level isn’t 100%. This behavior can be disabled in the
IE driver by setting the “ignoreZoomLevel” capability. Fixes Issue #4272.
* Stop execution when a call to IWebBrowser2::Navigate2() fails in the IE
driver. This prevents a hang when we weren’t checking for an error
condition. Fixes issue #4279.

* Handle quirky handling of mime types if Firefox was ever the default browser
on a Windows installation, but now a different (non-IE) browser has stepped
into that role.
* Increased timeout for finding file upload dialog in uploading file. Fixes
issue #3858.
* Updated initialization of variables in MouseMoveToCommandHandler.h and in
GetElementLocationOnceScrolledIntoViewCommandHandler.h. Fixes issue #4205.
* Updates to JavaScript automation atoms.
* Release to coincide with full Selenium release.

* Refactoring command line argument handling in IEDriverServer.exe, now that
the number of valid arguments is growing.
* Added ability to control log level and log file via command line switches to
IEDriverServer.exe (on behalf of AlexandrSavchuk).
* Re-added else-if for GetSessionList command inadvertently removed in r15345.
Fixes issue #4160.
* Added logging message to a large portion of the IE driver (on behalf of
AlexandrSavchuk). Set the log file with


(default is to log to the console). Set the logging level with


where LOGLEVEL is one of TRACE, DEBUG, INFO, WARN, ERROR, or FATAL (default
is FATAL). Fixes issue #4159

* Added elementScrollBehavior capability to allow users to specify how
elements scroll into the viewport for interaction. Default behavior is
unchanged (the capability is set to 0), but can be set to scroll to align
to the bottom of the viewport by setting the capability to 1.
* Updates to JavaScript automation atoms.

* Updates to JavaScript automation atoms.
* Release to coincide with full Selenium release.

* Crash prevention for when there is no “current” browser window, like when
the current window is closed without the user switching to another window.
Fixes issue #4071.

* Crash prevention for when IWebBrowser2::get_Document() returns S_FALSE.
Fixes issue #4064.

* Updated error messaging for certain conditions of Element.Click()

* Updates to JavaScript automation atoms.
* Release to coincide with full Selenium release.

* Updates to JavaScript automation atoms.

* Re-enabling native code driver to understand “nativeEvents” capability.
This was disabled due to CI-build restrictions which have now been resolved.

* Initial release required by client language bindings.


电子邮件地址不会被公开。 必填项已用*标注