Quits the driver and closes every associated window.
(self)
| 713 | self.execute(Command.CLOSE) |
| 714 | |
| 715 | def quit(self) -> None: |
| 716 | """Quits the driver and closes every associated window.""" |
| 717 | try: |
| 718 | # Close the BiDi/CDP websocket before deleting the session so the |
| 719 | # close is initiated from our side. |
| 720 | if self._websocket_connection is not None: |
| 721 | self._websocket_connection.close() |
| 722 | self._websocket_connection = None |
| 723 | self.execute(Command.QUIT) |
| 724 | finally: |
| 725 | if self._request is not None: |
| 726 | self._request.dispose() |
| 727 | self._request = None |
| 728 | self.stop_client() |
| 729 | executor = cast(RemoteConnection, self.command_executor) |
| 730 | executor.close() |
| 731 | |
| 732 | @property |
| 733 | def current_window_handle(self) -> str: |