You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
JavascriptExecutor.executeScript implementation on InternetExplorerDriver is inconsistent in marshalling Double/Long numbers from JavaScript to Java #4036
What steps will reproduce the problem?
ExecuteScript method in JavascriptExecutor has the capability to marshall JavaScript
numbers as Long or Double depending on the value. But this behavior is not consistent
in InternetExplorerDriver on Windows 7 vs Windows XP.
The following line:
((JavascriptExecutor) driver).executeScript("return parseFloat('2016');");
returns Long (2016L) on Windows XP and Double (2016.0d) on Windows 7 when tested using
InternetExplorerDriver.
What is the expected output? What do you see instead?
The following code snippet:
<snip>
Object ret = ((JavascriptExecutor) driver).executeScript("return parseFloat('2016');");
System.out.println(ret);
System.out.println(ret.getClass());
</snip>
> returns 2016L on InternetExplorerDriver (IE8) on *Windows XP*.
> returns 2016.0d when using InternetExplorerDriver (IE8/IE9) on *Windows 7*.
No such behavioral difference is noticed when tested on ChromeDriver (18) and FirefoxDriver
(5/9/11) on Windows XP and 7 (always returns Long).
-------------------------------------------------------
Selenium version: 2.20.0
OS: Windows XP and Windows 7
Browser: Internet Explorer
Browser version: IE 8 and 9