Quits the driver and closes every associated window.
(self)
| 635 | self.execute(Command.CLOSE) |
| 636 | |
| 637 | def quit(self) -> None: |
| 638 | """Quits the driver and closes every associated window.""" |
| 639 | try: |
| 640 | # Close the BiDi/CDP websocket before deleting the session so the |
| 641 | # close is initiated from our side. |
| 642 | if self._websocket_connection is not None: |
| 643 | self._websocket_connection.close() |
| 644 | self._websocket_connection = None |
| 645 | self.execute(Command.QUIT) |
| 646 | finally: |
| 647 | if self._request is not None: |
| 648 | self._request.dispose() |
| 649 | self._request = None |
| 650 | self.stop_client() |
| 651 | executor = cast(RemoteConnection, self.command_executor) |
| 652 | executor.close() |
| 653 | |
| 654 | @property |
| 655 | def current_window_handle(self) -> str: |