Skip to content
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.

ParseJavaScriptReturnValue should NOT parse objects containing an id field as RemoteWebElement #8048

Open
@lukeis

Description

@lukeis

Originally reported on Google Code with ID 8048

This started happening in Selenium 2.43.0. The change responsible for this can be found
in dotnet/src/webdriver/Remote/RemoteWebDriver.cs, method private object ParseJavaScriptReturnValue(object
responseValue), line 1174.

In 2.42.2, resultAsDictionary would only be treated as a RemoteWebElement if it contained
the key "ELEMENT". In 2.43.0, it is also treated as a RemoteWebElement if it contains
the key "id".

This is a problem because there are a lot of things that use objects with an "id" field.
In my particular case, the website's dataLayer has an array[] that contains an object
with an id field, among other values. This was requested by a third party tracker to
do various analytics on our traffic. As it is implemented now in 2.43.0, ExecuteScript("return
dataLayer;") will return the RemoteWebElement, with an id value, but everything else
gets lost.

I can imagine this isn't the only case. I've found quite a few people complaining about
this but not knowing why it's happening while I was googling for a cause. I'm hoping
someone agrees that "id" is too generic to assume it's a RemoteWebElement object and
removes it.

Reported by razvan.s.dicu on 2014-10-16 07:36:25

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions