Skip to content

Commit 2ea95d2

Browse files
committed
Adding 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 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.
1 parent 79ea708 commit 2ea95d2

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

cpp/iedriver/CommandHandlers/ScreenshotCommandHandler.h

+6
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ class ScreenshotCommandHandler : public IECommandHandler {
182182
hook_settings.communication_type = OneWay;
183183

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

187193
hook.PushData(sizeof(max_image_dimensions), &max_image_dimensions);

cpp/iedriver/InputManager.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,14 @@ int InputManager::SendKeystrokes(BrowserHandle browser_wrapper, Json::Value keys
523523
}
524524
if (this->enable_native_events()) {
525525
HWND window_handle = browser_wrapper->GetContentWindowHandle();
526+
HookProcessor hook;
527+
if (!hook.CanSetWindowsHook(window_handle)) {
528+
LOG(WARN) << "SENDING KEYSTROKES WILL BE SLOW! There is a mismatch "
529+
<< "in the bitness between the driver and browser. In "
530+
<< "particular, be sure you are not attempting to use a "
531+
<< "64-bit IEDriverServer.exe against IE 10 or 11, even on "
532+
<< "64-bit Windows.";
533+
}
526534
if (this->require_window_focus_) {
527535
LOG(DEBUG) << "Queueing Sendinput structures for sending keys";
528536
for (unsigned int char_index = 0; char_index < keys.size(); ++char_index) {

cpp/iedriver/ProxyManager.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,13 @@ void ProxyManager::SetPerProcessProxySettings(HWND browser_window_handle) {
231231
hook_settings.communication_type = OneWay;
232232

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

0 commit comments

Comments
 (0)