Marionette should return valid UUID

RESOLVED FIXED in Firefox 42

Status

RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: automatedtester, Assigned: automatedtester)

Tracking

unspecified
mozilla43
Points:
---

Firefox Tracking Flags

(firefox42 fixed, firefox43 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
STR

    POST /session with

{"desiredCapabilities":{"browserName":"firefox","name":"intern.js","idle-timeout":60}}

Actual

wires response

{
  "sessionId": "{e55fd540-babf-3548-86e8-2e20b8fb3bb1}",
  "value": {
    "XULappId": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
    "acceptSslCerts": false,
    "appBuildId": "20150819030206",
    "browserName": "Firefox",
    "browserVersion": "43.0a1",
    "device": "desktop",
    "platform": "DARWIN",
    "platformName": "DARWIN",
    "platformVersion": "43.0a1",
    "proxy": {},
    "raisesAccessibilityExceptions": false,
    "rotatable": false,
    "takesElementScreenshot": true,
    "takesScreenshot": true,
    "version": "43.0a1"
  }
}

Expected

Expected to have sessionId to be a valid uuid.v4 ( https://en.wikipedia.org/wiki/Universally_unique_identifier ) without { }

Selenium response

{
  "sessionId": "b510d3dd-5939-4b0e-a523-1a1a90498b0d",
  "status": 0,
  "state": null,
  "value": {
    "platform": "MAC",
    "javascriptEnabled": true,
    "acceptSslCerts": true,
    "browserName": "firefox",
    "rotatable": false,
    "locationContextEnabled": true,
    "webdriver.remote.sessionid": "b510d3dd-5939-4b0e-a523-1a1a90498b0d",
    "version": "40.0",
    "databaseEnabled": true,
    "cssSelectorsEnabled": true,
    "handlesAlerts": true,
    "webStorageEnabled": true,
    "nativeEvents": false,
    "applicationCacheEnabled": true,
    "takesScreenshot": true
  },
  "class": "org.openqa.selenium.remote.Response",
  "hCode": 1424204968
}
(Assignee)

Updated

3 years ago
Assignee: nobody → dburns
(Assignee)

Comment 1

3 years ago
Created attachment 8652010 [details]
MozReview Request: Bug 1196987: Update Marionette Session IDs to be valid UUID. r?ato

Bug 1196987: Update UUID returned to be a valid UUID 4; r?jgriffin

Currently the UUID returns the `{}` which is not valid and breaks
URI Templates used in WebDriver languages
Attachment #8652010 - Flags: review?(jgriffin)
Attachment #8652010 - Flags: review?(jgriffin) → review+
Comment on attachment 8652010 [details]
MozReview Request: Bug 1196987: Update Marionette Session IDs to be valid UUID. r?ato

https://reviewboard.mozilla.org/r/17047/#review15179

Ship It!
(Assignee)

Comment 3

3 years ago
url:        https://hg.mozilla.org/integration/mozilla-inbound/rev/f56c58238801ee4886bb4da3d64b33e729bead0f
changeset:  f56c58238801ee4886bb4da3d64b33e729bead0f
user:       David Burns <dburns@mozilla.com>
date:       Mon Aug 24 23:15:46 2015 +0100
description:
Bug 1196987: Update UUID returned to be a valid UUID 4; r=jgriffin

Currently the UUID returns the `{}` which is not valid and breaks
URI Templates used in WebDriver languages
https://hg.mozilla.org/mozilla-central/rev/f56c58238801
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox43: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
(Assignee)

Comment 5

3 years ago
Please sir, can you uplift to aurora a=test-only
Flags: needinfo?(ryanvm)
Flags: needinfo?(ryanvm)
(Assignee)

Comment 7

3 years ago
Comment on attachment 8652010 [details]
MozReview Request: Bug 1196987: Update Marionette Session IDs to be valid UUID. r?ato

Bug 1196987: Update Marionette element IDs to be valid UUID. r?ato

This allows WebDriver compatibility to create valid URI.
Attachment #8652010 - Attachment description: MozReview Request: Bug 1196987: Update UUID returned to be a valid UUID 4; r?jgriffin → MozReview Request: Bug 1196987: Update Marionette element IDs to be valid UUID. r?ato
Attachment #8652010 - Flags: review?(ato)
Comment on attachment 8652010 [details]
MozReview Request: Bug 1196987: Update Marionette Session IDs to be valid UUID. r?ato

https://reviewboard.mozilla.org/r/17047/#review15345

::: testing/marionette/client/marionette/tests/unit/test_findelement.py:167
(Diff revision 2)
> +        self.assertNotIn("{", el.id, 'element id has {{ in it. Id has {}'.format(el.id))

The regular expression

    /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i

would probably be a better test since it checks that the UUID is compatible with RFC 4122 version 1 through 5 according to [this answer](http://stackoverflow.com/questions/7905929/how-to-test-valid-uuid-guid) on Stackoverflow.

::: testing/marionette/elements.js:236
(Diff revision 2)
> -    let id = uuidGen.generateUUID().toString();
> +    let uuid = uuidGen.generateUUID().toString();
> +    let id = uuid.substring(1, uuid.length - 1);

It would be nice if this was made into a library function we shared across files, because I will need to use this when the `ListenerProxy` starts generating its own UUID internally instead of passing along command ID.

I didn’t open an issue on this, so feel free to fix or not fix.  I’ll get around to it when I do my patch to the proxy anyway.
Attachment #8652010 - Flags: review?(ato)
(Assignee)

Updated

3 years ago
Attachment #8652010 - Attachment description: MozReview Request: Bug 1196987: Update Marionette element IDs to be valid UUID. r?ato → MozReview Request: Bug 1196987: Update Marionette Session IDs to be valid UUID. r?ato
You need to log in before you can comment on or make changes to this bug.