Bug 1453084 - Add webdriver.Element string representation. r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Tue, 10 Apr 2018 19:55:04 +0100
changeset 779871 4cf4a1da1969aa3ea66eb87d60a6737f08b16497
parent 779870 8f30cfe09c0f220f526cdc53e453ff02298e28bd
push id105899
push userbmo:ato@sny.no
push dateTue, 10 Apr 2018 18:56:01 +0000
reviewerswhimboo
bugs1453084
milestone61.0a1
Bug 1453084 - Add webdriver.Element string representation. r?whimboo MozReview-Commit-ID: LM2JHTKenXu
testing/web-platform/tests/tools/webdriver/webdriver/client.py
--- a/testing/web-platform/tests/tools/webdriver/webdriver/client.py
+++ b/testing/web-platform/tests/tools/webdriver/webdriver/client.py
@@ -626,16 +626,19 @@ class Element(object):
         :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
 
+    def __repr__(self):
+        return "<%s %s>" % (self.__class__.__name__, self.id)
+
     def __eq__(self, other):
         return (isinstance(other, Element) and self.id == other.id and
                 self.session == other.session)
 
     @classmethod
     def from_json(cls, json, session):
         assert Element.identifier in json
         uuid = json[Element.identifier]