Skip to content
Snippets Groups Projects
Commit ca6428c4 authored by Andreas Tolfsen's avatar Andreas Tolfsen
Browse files

Bug 1411281 - Swap webdriver.Element ctor arguments r=jgraham

It is more natural for the web element UUID to come first, followed
by the associated session state.

The patch also adds ctor documentation.

MozReview-Commit-ID: 5iV4SZzMeKS

--HG--
extra : rebase_source : e9f68a2a934b2c13a9d1d913204e7e3d9bce6b42
parent ffe20afd
No related branches found
No related tags found
No related merge requests found
......@@ -548,7 +548,7 @@ class Session(object):
assert elem_id
if elem_id in self._element_cache:
return self._element_cache[elem_id]
return Element(self, elem_id)
return Element(elem_id, self)
@command
def cookies(self, name=None):
......@@ -619,9 +619,17 @@ class Element(object):
"""
identifier = "element-6066-11e4-a52e-4f735466cecf"
def __init__(self, session, id):
self.session = session
def __init__(self, id, session):
"""
Construct a new web element representation.
:param id: Web element UUID which must be unique across
all browsing contexts.
:param session: Current ``webdriver.Session``.
"""
self.id = id
self.session = session
assert id not in self.session._element_cache
self.session._element_cache[self.id] = self
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment