File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
py/selenium/webdriver/remote Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -271,9 +271,19 @@ def __init__(
271271 self ._devtools = None
272272
273273 def __repr__ (self ):
274+ """Return a string representation of the WebDriver object.
275+
276+ Returns:
277+ A string representation showing the module, class name, and session ID.
278+ """
274279 return f'<{ type (self ).__module__ } .{ type (self ).__name__ } (session="{ self .session_id } ")>'
275280
276281 def __enter__ (self ):
282+ """Enter the context manager.
283+
284+ Returns:
285+ The WebDriver instance for use in the with block.
286+ """
277287 return self
278288
279289 def __exit__ (
@@ -282,6 +292,15 @@ def __exit__(
282292 exc : Optional [BaseException ],
283293 traceback : Optional [types .TracebackType ],
284294 ):
295+ """Exit the context manager.
296+
297+ Quits the WebDriver session when exiting the with block.
298+
299+ Args:
300+ exc_type: The exception type if an error occurred in the with block.
301+ exc: The exception value if an error occurred in the with block.
302+ traceback: The traceback if an error occurred in the with block.
303+ """
285304 self .quit ()
286305
287306 @contextmanager
You can’t perform that action at this time.
0 commit comments