New issue
Advanced search Search tips

Issue 678121 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Jan 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

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'}
 

Comment 1 by ajha@chromium.org, Jan 4 2017

Labels: Needs-Milestone
Labels: Hotlist-Interop
// Clay who filed this bug is on Edge Web Platform, and he mentioned this is an Interop issue +Hotlist-Interop
Labels: -Hotlist-Interop
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

Comment 4 by phistuck@gmail.com, 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?).
Labels: Needs-Triage-M57
Labels: TE-NeedsTriageHelp

Comment 7 by phistuck@gmail.com, 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.

Comment 8 by alph@chromium.org, Jan 10 2017

Status: WontFix (was: Unconfirmed)
So I'm closing it.

Sign in to add a comment