ChromeDriver returns an object as an array if it has a property named length with a number value
Reported by
instyle...@gmail.com,
Jan 3 2017
|
||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15002
Steps to reproduce the problem:
1. Run Chrome with ChromeDriver
2. Execute Script with return {'length':1,'foo':'bar'};
What is the expected behavior?
ChromeDriver returns an object as such:
{'length':1,'foo':'bar'}
What went wrong?
ChromeDriver returns an array as such:
[null]
Did this work before? N/A
Chrome version: 52.0.2743.116 Channel: n/a
OS Version: 10.0
Flash Version:
Note that if you run:
return {'length':1,'0':'bar'}
that you'll get the first value of the array back
['bar']
and that if you run:
return {'length':'1','foo':'bar'}
that you'll get an object back
{'length':'1','foo':'bar'}
,
Jan 5 2017
// Clay who filed this bug is on Edge Web Platform, and he mentioned this is an Interop issue +Hotlist-Interop
,
Jan 5 2017
I am not sure this qualifies as an interoperability issue, it is not an open web platform issue (this is not observable to web pages), it is a ChromeDriver interface specific issue. I see that the Developer Tools console gets it right - it did not until some time ago, so it is probably a glue-level issue. Also, maybe this needs to be filed in the ChromeDriver issue tracker? https://bugs.chromium.org/p/chromedriver/issues/list
,
Jan 5 2017
Also, I reckon your report does not mention the real version you tested (it uses the Edge user agent with which you filed it for extracting this information, so 52) Make sure you use the latest version of Chrome and ChromeDriver (and Selenium?).
,
Jan 6 2017
,
Jan 6 2017
,
Jan 6 2017
I just checked and the Developer Tools feature returns it as an array only if you also define a splice method. https://cs.chromium.org/chromium/src/v8/src/inspector/injected-script-source.js?q=result+object+array+className+description+objectId&sq=package:chromium&dr=CSs&l=572 https://cs.chromium.org/chromium/src/v8/src/inspector/injected-script-source.js?q=result+object+array+className+description+objectId&sq=package:chromium&dr=CSs&l=118 So it really seems like a ChromeDriver issue, not a Developer Tools related one. I could not anything in the ChromeDriver code yet, though.
,
Jan 10 2017
So I'm closing it. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by ajha@chromium.org
, Jan 4 2017