Quits the driver and closes every associated window.
(self)
| 646 | self.execute(Command.CLOSE) |
| 647 | |
| 648 | def quit(self) -> None: |
| 649 | """Quits the driver and closes every associated window.""" |
| 650 | try: |
| 651 | # Close the BiDi/CDP websocket before deleting the session so the |
| 652 | # close is initiated from our side. |
| 653 | if self._websocket_connection is not None: |
| 654 | self._websocket_connection.close() |
| 655 | self._websocket_connection = None |
| 656 | self.execute(Command.QUIT) |
| 657 | finally: |
| 658 | if self._request is not None: |
| 659 | self._request.dispose() |
| 660 | self._request = None |
| 661 | self.stop_client() |
| 662 | executor = cast(RemoteConnection, self.command_executor) |
| 663 | executor.close() |
| 664 | |
| 665 | @property |
| 666 | def current_window_handle(self) -> str: |