Skip to content

Commit

Permalink
Adding logging messages for IE driver for bitness mismatches
Browse files Browse the repository at this point in the history
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 want to use the 64-bit
IEDriverServer.exe when running against 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.
  • Loading branch information
jimevans committed Aug 11, 2015
1 parent 79ea708 commit 2ea95d2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cpp/iedriver/CommandHandlers/ScreenshotCommandHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ class ScreenshotCommandHandler : public IECommandHandler {
hook_settings.communication_type = OneWay;

HookProcessor hook;
if (!hook.CanSetWindowsHook(ie_window_handle)) {
LOG(WARN) << "Screenshot will be truncated! There is a mismatch "
<< "in the bitness between the driver and browser. In "
<< "particular, you are likely using a 32-bit "
<< "IEDriverServer.exe and a 64-bit version of IE.";
}
hook.Initialize(hook_settings);

hook.PushData(sizeof(max_image_dimensions), &max_image_dimensions);
Expand Down
8 changes: 8 additions & 0 deletions cpp/iedriver/InputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,14 @@ int InputManager::SendKeystrokes(BrowserHandle browser_wrapper, Json::Value keys
}
if (this->enable_native_events()) {
HWND window_handle = browser_wrapper->GetContentWindowHandle();
HookProcessor hook;
if (!hook.CanSetWindowsHook(window_handle)) {
LOG(WARN) << "SENDING KEYSTROKES WILL BE SLOW! There is a mismatch "
<< "in the bitness between the driver and browser. In "
<< "particular, be sure you are not attempting to use a "
<< "64-bit IEDriverServer.exe against IE 10 or 11, even on "
<< "64-bit Windows.";
}
if (this->require_window_focus_) {
LOG(DEBUG) << "Queueing Sendinput structures for sending keys";
for (unsigned int char_index = 0; char_index < keys.size(); ++char_index) {
Expand Down
7 changes: 7 additions & 0 deletions cpp/iedriver/ProxyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ void ProxyManager::SetPerProcessProxySettings(HWND browser_window_handle) {
hook_settings.communication_type = OneWay;

HookProcessor hook;
if (!hook.CanSetWindowsHook(browser_window_handle)) {
LOG(WARN) << "Proxy will not be set! There is a mismatch in the "
<< "bitness between the driver and browser. In particular, "
<< "be sure you are not attempting to use a 64-bit "
<< "IEDriverServer.exe against IE 10 or 11, even on 64-bit "
<< "Windows.";
}
hook.Initialize(hook_settings);
hook.PushData(proxy);
LRESULT result = ::SendMessage(browser_window_handle,
Expand Down

0 comments on commit 2ea95d2

Please sign in to comment.