W3C home > Mailing lists > Public > public-browser-tools-testing@w3.org > April to June 2014

[Bug 26158] New: JSON serialization of element does not make clear that JSON represents an element

From: <bugzilla@jessica.w3.org>
Date: Fri, 20 Jun 2014 20:28:44 +0000
To: public-browser-tools-testing@w3.org
Message-ID: <bug-26158-5015@http.www.w3.org/Bugs/Public/>

            Bug ID: 26158
           Summary: JSON serialization of element does not make clear that
                    JSON represents an element
           Product: Browser Test/Tools WG
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: WebDriver
          Assignee: public-browser-tools-testing@w3.org
          Reporter: james.h.evans.jr@gmail.com
        QA Contact: public-browser-tools-testing@w3.org
                CC: mike@w3.org

Section 9.1 states that the WebElement interface has an attribute named "id".
Thus, when serialized, a reference to an element when returned from a
JavaScript execution would look like this:

{"id": "<element id>"}

Now consider returning a JavaScript object literal with the following JSON

{"id": "this is my super ID value"}

It will be impossible to distinguish between a legitimate WebElement reference,
and an object literal when evaluating the returned JSON value. The Selenium
open-source project mitigates this by using a property name of "ELEMENT"
instead of "id" for element references. Using "id" is problematic, merely
because there are any number of uses for returning an object with an "id"
property. Renaming the property to something like "webdriverElementId" would
likely resolve the issue.

You are receiving this mail because:
You are the QA Contact for the bug.
Received on Friday, 20 June 2014 20:28:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:09:50 UTC