diff --git a/cpp/iedriver/VariantUtilities.cpp b/cpp/iedriver/VariantUtilities.cpp index 349123e397c95..af99c63e97d65 100644 --- a/cpp/iedriver/VariantUtilities.cpp +++ b/cpp/iedriver/VariantUtilities.cpp @@ -188,7 +188,17 @@ int VariantUtilities::ConvertVariantToJsonValue(IElementManager* element_manager } else if (VariantIsInteger(variant_value)) { *value = variant_value.lVal; } else if (VariantIsDouble(variant_value)) { - *value = variant_value.dblVal; + double int_part; + if (std::modf(variant_value.dblVal, &int_part) == 0.0) { + // This bears some explaining. Due to inconsistencies between versions + // of the JSON serializer we use, if the value is floating-point, but + // has no fractional part, convert it to a 64-bit integer so that it + // will be serialized in a way consistent with language bindings' + // expectations. + *value = static_cast(int_part); + } else { + *value = variant_value.dblVal; + } } else if (VariantIsBoolean(variant_value)) { *value = variant_value.boolVal == VARIANT_TRUE; } else if (VariantIsEmpty(variant_value)) { diff --git a/cpp/iedriverserver/CHANGELOG b/cpp/iedriverserver/CHANGELOG index 101feb34b9cbc..72494ccbb7f5c 100644 --- a/cpp/iedriverserver/CHANGELOG +++ b/cpp/iedriverserver/CHANGELOG @@ -9,6 +9,22 @@ 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. +v3.11.1.2 +========= + * Changed COM variant to JSON serialization in IE. There is an expectation + that if a result from JavaScript is "integral," that it is serialized for + return to the calling code as an integral number rather than a floating- + point number. Previous versions of the JSON serializer used by the IE + driver would (incorrectly) serialize a floating-point value with no + decimal part as being an integer. After updating to a later version, the + serializer now (correctly) serializes floating-point values as floating- + point values, with a trailing ".0" to indicate a floating-point value. + While this is the correct behavior by the serializer, it breaks the + expectations of the language bindings. Therefore, we check to see if the + variant value has a decimal part, and if it has none, convert it to an + integer for serialization by the JSON library. + * Updated JsonCpp library to latest source code. Fixes issue #5664. + v3.11.1.1 ========= * Separated out detection of focusable elements for sendKeys in IE. Allows diff --git a/cpp/iedriverserver/IEDriverServer.rc b/cpp/iedriverserver/IEDriverServer.rc index ccb6ebb14d49d..ba35dd2d599d3 100644 --- a/cpp/iedriverserver/IEDriverServer.rc +++ b/cpp/iedriverserver/IEDriverServer.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,11,1,1 - PRODUCTVERSION 3,11,1,1 + FILEVERSION 3,11,1,2 + PRODUCTVERSION 3,11,1,2 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "Software Freedom Conservancy" VALUE "FileDescription", "Command line server for the IE driver" - VALUE "FileVersion", "3.11.1.1" + VALUE "FileVersion", "3.11.1.2" VALUE "InternalName", "IEDriverServer.exe" VALUE "LegalCopyright", "Copyright (C) 2017" VALUE "OriginalFilename", "IEDriverServer.exe" VALUE "ProductName", "Selenium WebDriver" - VALUE "ProductVersion", "3.11.1.1" + VALUE "ProductVersion", "3.11.1.2" END END BLOCK "VarFileInfo" diff --git a/cpp/prebuilt/Win32/Release/IEDriverServer.exe b/cpp/prebuilt/Win32/Release/IEDriverServer.exe index 2101576f03466..8e25df081e493 100644 Binary files a/cpp/prebuilt/Win32/Release/IEDriverServer.exe and b/cpp/prebuilt/Win32/Release/IEDriverServer.exe differ diff --git a/cpp/prebuilt/x64/Release/IEDriverServer.exe b/cpp/prebuilt/x64/Release/IEDriverServer.exe index 7e85d63de7f53..8625f97c6e132 100644 Binary files a/cpp/prebuilt/x64/Release/IEDriverServer.exe and b/cpp/prebuilt/x64/Release/IEDriverServer.exe differ