Bug 1434872 - [wdclient] Handle SessionNotCreatedException in session.send_command().
In case the driver already deleted the session (eg last window closed)
make sure to also invalidate the internal session id.
MozReview-Commit-ID: EIbrEDk73jN
--- a/testing/web-platform/tests/tools/webdriver/webdriver/client.py
+++ b/testing/web-platform/tests/tools/webdriver/webdriver/client.py
@@ -430,17 +430,23 @@ class Session(object):
an error.
"""
response = self.transport.send(
method, url, body,
encoder=protocol.Encoder, decoder=protocol.Decoder,
session=self)
if response.status != 200:
- raise error.from_response(response)
+ err = error.from_response(response)
+
+ if isinstance(err, error.SessionNotCreatedException):
+ # The driver could have already been deleted the session.
+ self.session_id = None
+
+ raise err
if "value" in response.body:
value = response.body["value"]
"""
Edge does not yet return the w3c session ID.
We want the tests to run in Edge anyway to help with REC.
In order to run the tests in Edge, we need to hack around
bug: